Repository navigation
Conversation
…ing a fixed template A Codex provider link that carries a config.toml lost everything except the key, base_url and model: query_params, http_headers, request_max_retries, stream_idle_timeout_ms, model_catalog_url and others were dropped, and model_reasoning_effort / requires_openai_auth were overwritten by the fixed template. Port the upstream desktop fix (farion1231/cc-switch 11e1326b): keep the provider-owned keys of the selected [model_providers.*] table (renamed to custom) plus the top-level provider fields the projection writes; reject tables that make Codex run a command or read local credentials (auth, aws, gateway_oauth, env_http_headers); drop env_key in favour of the link's key and reject env_key-only links; keep model_catalog_url only on the endpoint's origin. URL params still win, and links without a config keep the existing template byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RGB-loop
marked this pull request as ready for review
November 17, 2026 15:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Importing a Codex provider from a
ccswitch://v1/import?resource=provider&app=codex&config=…link keeps only the API key,base_urlandmodelfrom the link'sconfig.toml.build_codex_settings()always rebuilds a fixed template, so:query_params(e.g.api-versionfor Azure-style endpoints),http_headers,supports_websockets,request_max_retries,stream_idle_timeout_ms,model_catalog_url… are silently dropped;model_reasoning_effortis overwritten with"high"and the storedrequires_openai_authwithtrue.The desktop app had the same bug (farion1231/cc-switch #3751, #5510, #7438, #7942) and fixed it in farion1231/cc-switch@11e1326b. This PR ports that fix for parity, per AGENTS.md.
Change
New
src/deeplink/codex_link.rs(ported from upstream 11e1326b), wired intomerge_codex_config/build_codex_settings:[model_providers.*]table (always renamed tocustom) and the top-level provider fields the live projection writes (ROW_TOP_FIELDS,CODEX_EXCLUSIVE_TOP, nested subagent/memory model names); user-global settings ([features],[tools], MCP,notify, …) are not imported;auth,aws,gateway_oauth,env_http_headers);env_keyin favour of the link's key; reject a link that only hasenv_key;model_catalog_urlonly when it is on the endpoint's origin;experimental_bearer_tokenis rewritten to the link's key;ROW_TOP_FIELDSbecomespub(crate)(same as upstream).Before / after (real binary, isolated HOME, dummy key)
Link config:
model_reasoning_effort = "low",query_params = { "api-version" = … },request_max_retries = 7,stream_idle_timeout_ms = 600000, same-originmodel_catalog_url.Before (9a2bdf5), stored row:
After:
A second link with
requires_openai_auth = false,http_headersandsupports_websocketsnow keeps all three, and they reach the live~/.codex/config.tomlafter switching.Tests
cargo fmt --checkcargo test --lib deeplink— 18 passed (11 new Codex link tests: field retention, URL override, catalog origin, rejected tables,env_key, whole-config.tomllinks, no-config template bytes)cargo test --test deeplink_import— 19 passedNot covered: no run against a real Codex relay.
🤖 Generated with Claude Code