Add multi-account token support for Codex and API-key providers#461
Add multi-account token support for Codex and API-key providers#461Minoo7 wants to merge 13 commits intosteipete:mainfrom
Conversation
| if self.settings.codexCookieSource == .manual, | ||
| !self.settings.tokenAccounts(for: .codex).isEmpty | ||
| { | ||
| return nil |
There was a problem hiding this comment.
Could this targetEmail becoming nil in manual token-account mode interact with the account-switch path in a way that keeps stale dashboard state after switching accounts?
| !previous.isEmpty, | ||
| previous != normalized | ||
| { | ||
| let emailChanged = if let previous, !previous.isEmpty, let normalizedOrNil { |
There was a problem hiding this comment.
Should transitions like previous email -> nil or previous tokenAccountID nil -> non-nil be treated as account changes here, or is there a reason we want to keep existing dashboard state in that first switch case?
| private static let headerPatterns: [String] = [ | ||
| #"(?i)-H\s*'Cookie:\s*([^']+)'"#, | ||
| #"(?i)-H\s*\"Cookie:\s*([^\"]+)\""#, | ||
| #"(?i)(?:^|\s)-H\s+'Cookie:\s*([^']+)'"#, |
There was a problem hiding this comment.
Are we intentionally requiring whitespace after -H now, or should compact forms like -H'Cookie: ...' still be accepted?
| #"(?i)(?:--cookie|-b)\s*'([^']+)'"#, | ||
| #"(?i)(?:--cookie|-b)\s*\"([^\"]+)\""#, | ||
| #"(?i)(?:--cookie|-b)\s*([^\s]+)"#, | ||
| #"(?i)(?:^|\s)(?:--cookie|-b)\s+'([^']+)'"#, |
There was a problem hiding this comment.
For --cookie / -b, do we still want to accept compact input like -b'...', or should it only match when there is whitespace?
Summary
Verification