fix(proxy): lift Codex additional_tools input carriers into chat tools - #476
Open
525300887039 wants to merge 1 commit into
Open
525300887039 wants to merge 1 commit into
525300887039 wants to merge 1 commit into
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
Related to #466.
Codex requests reported with Desktop 26.901 / codex.exe 0.153.4 carry tools in
additional_toolsinput items. Those tools were not collected before proxyconversion, leaving the upstream Chat model without the carried tools.
additional_toolsinput items (arrayelements or the already-supported single input object) using the existing
registry. Keep top-level priority, input order and first-definition dedup.
Chat messages or Anthropic system/messages. Preserve real messages and
pending tool calls, media and reasoning.
declarations. Preserve the existing recursive
tool_search_outputbehavior.Adapted from farion1231/cc-switch#7454
(
a35e5000b4ef809ed76eb36bd164bf6a35c36afc) with a direct-input boundaryguard and consistent carrier handling in both converters. Changes are limited to
src-tauri/src/proxy/providers/transform_codex_chat.rsandsrc-tauri/src/proxy/providers/transform_codex_anthropic.rs.Testing
Run from
src-tauri/with Rust 1.91.1 and isolated configuration directories:cargo test --lib --no-default-features additional_tools: 8 passed. Theoriginal omission, nested-marker regression and Anthropic content leak were
demonstrated failing before their respective fixes. The new table-driven
test checks four carrier roles with string/array content against both actual
request converters, preserving the real instructions, user message and tools.
19 / 20 passed. Tests cover registration order, dedup, history names,
response restoration and unchanged pending state.
cargo test --no-fail-fast: 4923 passed, 5 failed, 2 ignored across 44targets on the final patch (excluding a duplicated subprocess result).
Only
prompt_commands(2 editor-configuration tests) andprovider_commands(3 official usage-template tests) failed; identical failures were reproduced
on the unmodified baseline. This is not a passing full-suite result.
cargo test --lib --no-default-features: 2077 passed, 0 failed, 2 ignored.CI unit commands: library 4363 passed, 2 ignored; binary 10 passed. The
CI-selected proxy integration cases passed (forwarder, daemon, proxy_database).
RUSTFLAGS="-D warnings"library-only check and compile-test, the CI directdependency guard, both changed-file
rustfmt --checkruns andgit diff --checkpassed.cargo clippy --lib --no-default-featurespassedwith existing warnings.
Notes
function; the namespace-nestedcustomtool in Proxy drops Codex tools sent asadditional_toolsinput items — model receives no tools #466's capture is still unsupported. This is a partialcompatibility fix, not a claim to resolve every reported tool shape.
cargo fmt --checkfails in five files(21 hunks from feat(auth): support Codex rate limit reset credits in quota inspection and consumption #475), and default-feature
cargo clippyfails withclippy::reversed_empty_rangesatsrc/cli/tui/ui/home_chart.rs:806.the earlier audit; they did not occur in this final run.
specific SSE cases and the two ignored benchmark tests were not run.