Repository navigation
fix(codex): restore flattened optimized tool calls to their namespace - #2901
Merged
jlcodes99 merged 2 commits intoOct 27, 2026
Merged
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.
Problem
The native gateway restores a flattened upstream call such as
collaboration-optimize__wait_agenttocollaboration__wait_agent, without anamespace. Codex declares this tool as
namespace: "collaboration"andname: "wait_agent", so the restored call is rejected with:This breaks multi-agent coordination when an upstream provider returns the
flattened wire form. A chained CPA can also perform its own restoration first,
returning
collaboration__wait_agentto Cockpit; that form needs the samecanonical identity when the original request declared the namespaced tool. The same restoration code is present in v1.3.73 and the
current main branch.
Changes
matching the existing dotted-name restoration.
collaboration__toolcalls from a chained CPA onlywhen this request declared that collaboration tool and no explicit flat-name
declaration conflicts. Unknown tools and other namespaces remain unchanged.
spawn/message/followup/wait calls in SSE item-added and item-done events.
canonical and flattened upstream calls. Keep request-context gating, call IDs,
arguments, input, and tool-result payloads intact.
Validation
Before the fix, the new restoration assertions fail and the flattened CLI
fixture reproduces
unsupported call: collaboration__wait_agent.After the fix:
undeclared names, conflicting flat declarations, namespace isolation, and
opaque payload preservation.
returning
collaboration__tool. The parent reachesPARENT_DONEafter actualchild-runtime creation and continuation without an unsupported-call error.
The CLI cases use an installed official CLI with temporary homes/workspaces and
a scripted loopback provider under the existing macOS network sandbox; they do
not use live model inference or account credentials.
cargo fmt --package cockpit-tools -- --checkreports repository-wide formattingdifferences, including untouched files. This PR keeps unrelated formatting out
of the patch.