fix(codex): repair MultiRouter routing and history sync - #22
Draft
KeLearns wants to merge 1 commit into
Draft
Conversation
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.
Summary
config.toml, instead of a hard-coded legacy bucket.Root cause
The retry chain expands MultiRouter routes ahead of
forward()and marks each attempt withcodexResolvedRouteId. The forwarder treated that marker as if the target provider had already been materialized. As a result, the attempt retained the parent router's localbase_urland authentication context, recursively called the local proxy, and skipped target-specific protocol/history handling.Unified history sync also assumed a fixed MultiRouter bucket. Current builds generate a stable bucket in the live Codex config, so JSONL
session_meta.model_providervalues and SQLitethreads.model_providerrows could be migrated into a bucket that Codex was not displaying.Changes
model_providerplus thex-cc-switch-proxy-mode = "router"marker.User impact
MultiRouter requests now reach the selected external or official upstream instead of recursively returning to
127.0.0.1. Target-specific request conversion and chat-history enrichment can run against the effective provider. Unified Codex history remains visible after switching to MultiRouter.Validation
v3.19.0-3binary tested withNew Codex MultiRouter.https://opencode.ai/zen/go/v1/responsesand returned HTTP 200.https://chatgpt.com/backend-api/codex/responsesand returned HTTP 200.cargo test codex_history_migration::tests --lib— 52 passed.cargo test proxy::forwarder::tests --lib— 116 passed.cargo check --libpassed (one pre-existing unused-function warning remains inproxy/usage/parser.rs).