Skip to content

fix: prevent unsupported Codex Web source mode - #541

Merged
Finesssee merged 1 commit into
mainfrom
codex/replace-pr512-unsupported-web-source
Sep 18, 2026
Merged

Finesssee merged 1 commit into
mainfrom
codex/replace-pr512-unsupported-web-source

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

This maintainer-owned PR preserves the source-mode fix from fork PR #512.

The original PR is from Dreamkeeper/Win-CodexBar, so the protected ci/circleci: pr-check status cannot run on its head branch. The two-file change was cherry-picked unchanged to an origin branch so the required hosted Windows gate can validate it against the current main.

Validation:

  • git diff --check
  • CircleCI ci/circleci: pr-check and CodeRabbit will run on this origin branch

Supersedes #512.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed provider refresh failures when an unsupported web source mode was selected.
    • Providers now fall back to the configured usage source or automatic mode when needed.
    • Manual cookies no longer override an explicitly configured OAuth usage source.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 78b24250-adbd-4e34-8e06-158cbfac23d4

📥 Commits

Reviewing files that changed from the base of the PR and between 5e1845f and cd7696f.

📒 Files selected for processing (2)
  • apps/desktop-tauri/src-tauri/src/commands/providers.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

build_fetch_context now avoids unsupported Web source modes. Codex tests verify fallback to Auto and preservation of an explicit supported OAuth source when a manual cookie is present.

Changes

Provider source-mode fallback

Layer / File(s) Summary
Provider-supported source selection
apps/desktop-tauri/src-tauri/src/commands/providers.rs, apps/desktop-tauri/src-tauri/src/commands/tests.rs
When Web is unavailable, build_fetch_context selects the configured supported source or Auto. Codex tests cover manual-cookie fallback and explicit OAuth selection.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: xuelongmu, tlq5l

Merge Risk: ⚪ Minimal · up to cd769

The fallback selects a supported source mode when Web is unavailable, with no confirmed merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing unsupported Codex Web source modes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Since the 0.54 port the Codex provider only supports Auto/OAuth/CLI and
rejects SourceMode::Web outright. The desktop shell's default cookie source
is "manual", so pasting a chatgpt.com Cookie header for Codex mapped the
provider to Web and every refresh failed with
"Source mode 'Web' not supported for this provider".

Add the inverse of the existing Cli remap in build_fetch_context: if the
resolved mode is Web and the provider does not advertise Web in
available_sources(), fall back to the configured usage source (or Auto).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@Finesssee
Finesssee force-pushed the codex/replace-pr512-unsupported-web-source branch from c5fbc3b to cd7696f Compare September 18, 2026 15:29
@Finesssee
Finesssee merged commit 10e3b09 into main Sep 18, 2026
3 checks passed
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.

2 participants