Block OpenCode Go cookie leakage on redirects#969
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a79b06c489
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| else { | ||
| completionHandler(nil) | ||
| return |
There was a problem hiding this comment.
Treat blocked auth redirects as invalid credentials
When this delegate cancels a cross-host redirect with completionHandler(nil), URLSession returns the original 3xx response to fetchServerText/fetchPageText, which currently maps most non-200 responses to .apiError unless the body contains login text. If OpenCode expires a session by redirecting to a login/auth host (a common pattern), this change turns an auth-expiry case into a generic API error, so the retry path in OpenCodeGoUsageFetchStrategy (which only catches .invalidCredentials) no longer runs and users can get stuck with stale cookies.
Useful? React with 👍 / 👎.
Summary
Verification
Note: branch name intentionally avoids slashes so the fork's current push CI branch pattern can match it.