Skip to content

Fix Grok OAuth when cookies are off - #384

Merged
Finesssee merged 1 commit into
mainfrom
fix/362-grok-oauth-cookie-off
Aug 24, 2026
Merged

Finesssee merged 1 commit into
mainfrom
fix/362-grok-oauth-cookie-off

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

  • fix [Bug]: Grok OAuth is bypassed when cookie source is off #362 so Grok keeps its OAuth credential path when browser cookies are explicitly disabled
  • preserve Grok Auto and OAuth usage-source selections as SourceMode::OAuth for cookie source off
  • apply the same OAuth fallback when cookie source is manual but no manual cookie is stored
  • keep explicit Grok Cli mode unchanged and never re-enable browser-cookie extraction

Root cause

build_fetch_context treated cookie source off as a provider-agnostic request for SourceMode::Cli. Grok's CLI credential selector rejects OIDC entries created by grok login, so the desktop shell returned AuthRequired even though the same ~/.grok/auth.json entry worked through the CLI diagnose path.

Validation

  • cargo fmt --all --check PASS
  • cargo test -p codexbar-desktop-tauri fetch_context_grok -- --nocapture PASS, 4/4
  • cargo clippy -p codexbar-desktop-tauri --all-targets -- -D warnings PASS

Regression coverage

  • cookie off + Grok Auto -> OAuth, no cookie header
  • cookie off + explicit Grok OAuth -> OAuth, no cookie header
  • cookie off + explicit Grok CLI -> CLI
  • manual cookie source + no stored cookie + Grok Auto -> OAuth without browser import

Closes #362.

@Finesssee

Finesssee commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thermo-nuclear review

No material code-quality findings. The provider-aware provider_uses_oauth_without_cookies helper consolidates Claude/Grok routing policy instead of scattering another special-case branch, and the regression tests cover the meaningful source-mode combinations.

Verdict: APPROVED.

@Finesssee
Finesssee merged commit 2f71865 into main Aug 24, 2026
2 checks passed
@Finesssee
Finesssee deleted the fix/362-grok-oauth-cookie-off branch August 28, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Grok OAuth is bypassed when cookie source is off

1 participant