Skip to content

fix(opencode): handle removed OpenAI OAuth auth - #40199

Open
opencode-agent[bot] wants to merge 2 commits into
devfrom
gpt56-stream-fix
Open

fix(opencode): handle removed OpenAI OAuth auth#40199
opencode-agent[bot] wants to merge 2 commits into
devfrom
gpt56-stream-fix

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • read the current OpenAI auth state before applying OAuth-only request mutations
  • pass requests through unchanged when OAuth auth was removed or replaced after provider loading
  • cover the mid-session auth removal race with a regression test

Root cause

The OpenAI Codex fetch wrapper outlived the OAuth credential that created it. When the credential was removed while a session was active, getAuth() returned undefined and the wrapper dereferenced .type, producing the minified undefined is not an object (evaluating 'M.type') stream failure.

Verification

  • Exact headless repro against the 1.18.11 release binary: reproduced the reported M.type failure by removing OAuth auth after provider loading
  • bun test test/plugin/codex.test.ts --timeout 30000 (18 passed)
  • git diff --check

Requested by: @Hona (Hona via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant