[Provider compatibility] undeclared_tool_call from a combo child's committed function_call never reaches the hop decision — guard-refused turns dead-end the combo
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Read src/server/responses-undeclared-tool-guard.ts, src/server/responses/combo-stream-preflight.ts, and src/combos/failover.ts, then trace how the required-tool contract reaches comboFailureDecision. Check the combo failover tests for coverage of suppressed output and relayed deltas. Done means a guard-refused turn can hop when no output reached the client, while relayed output still prevents replay; the issue says a fix is already in progress as PR #9164.
Written by the indexing model from the issue text.
Description
Client or integration
Codex CLI
Provider or upstream service
zai (glm-5.3, glm-5.3-flash), opendesign (deepseek-v4.1-flash), anthropic-apikey (claude-sonnet-5-5) — via lane combos (strategy: "failover")
OpenCodex version
2.100.8 → 2.100.10 (npm installer, macOS arm64)
Endpoint or capability
/v1/responses — tool calls under combo streaming; interaction between the undeclared-tool guard and combo failover
Current behaviour
A combo child's model answers with a function_call naming a tool the request never declared. The undeclared-tool guard (src/server/responses-undeclared-tool-guard.ts) suppresses the item and synthesizes a terminal response.failed with code undeclared_tool_call — correct, fail-closed. But the combo never hops to its other targets, for two reasons in the 2.100.10 tree:
UNDECLARED_TOOL_CALL_ERROR_CODEappears nowhere insrc/combos/failover.ts— the hop vocabulary has no entry for this code.- In
src/server/responses/combo-stream-preflight.ts,comboStreamPayloadCommitsOutputtreats anyresponse.output_item.addedas committing, so the child is considered to have delivered output even though the client never received that item (the guard suppressed it) and nothing client-executed ran.
#8871 (carrying #8563) already made combos hop on the upstream-400 verdict shape — a provider refusing pre-output with The model called a function that was not offered in tools. (isUnofferedToolCallRefusal, src/combos/failover.ts:1958). That path works. The stream-level shape above is the remaining dead end: the guard refusal never reaches comboFailureDecision.
Closest precedent in-tree: the required-tool contract carve-out in retryableZeroOutputTerminal — REQUIRED_TOOL_CONTRACT_CODE is judged on what the client actually received ("it synthesizes this terminal over output it held back from the client, so held text and reasoning are not evidence of anything sent"). The undeclared-tool refusal is the missing sibling: same synthesized-terminal shape, same nothing-reached-the-client property, no equivalent carve-out.
Expected behaviour
A guard-refused turn — the client received only the synthesized undeclared_tool_call terminal, no relayed output — should be a hop signal for multi-target combos, under the same replay-safety discipline the required-tool guard uses: any output the client genuinely received (a relayed text delta before the offending item) still vetoes the replay; suppressed items do not. The refusal is deterministic per target but target-local: another model may know the tool or not hallucinate the name, which is exactly what strategy: "failover" is for. Concrete client requirement: the combo layer's own documented behaviour (#8871) — target-local model misbehaviour advances the chain instead of ending it.
Minimal redacted request or reproduction
# Codex CLI pointed at the proxy; request declares a Codex-standard tool catalog
# (exec-centric); combo lane serves it with the failover targets above.
ocx start
# Run any long-horizon agentic turn whose history includes foreign tool names
# (e.g. code_runner/bash from another client's transcripts); a routed model
# eventually echoes such a name as a function_call.
# Observed on this rig: 84 failed member turns in one swarm program on
# 2026-11-26 09:30–11:20 local, clustering on combo/lane/orchestration and
# opendesign/deepseek-v4.1-flash; recurring in logs 2026-11-11 → 2026-11-26,
# always terminal, never hopped. Ledger records show failureStage
# semantic-output / side-effect — the pre-commit classifier reads the call item
# as committed output, which is the veto.
Actual response or error
# Buffered wire: HTTP 502
{"error":{"type":"upstream_error","code":"undeclared_tool_call","message":"routed provider emitted undeclared client tool \"code_runner/bash\"; only request-declared tools may be called"}}
# SSE wire: response.failed with the same error record, then data: [DONE]
# Ledger record ocx-8033046ee7ac337b2dbd3d7126784a76 (2026-11-03,
# anthropic-apikey / claude-sonnet-5-5): the name is not an alias of any
# declared tool — the model echoed a tool name from earlier items in the
# conversation (a different client's harness). The guard is right to refuse;
# this report asks for recovery routing, not relaying.
Upstream documentation
No public provider specification exists for this behaviour — the refusal is proxy-synthesized, not upstream. The governing specs are the project's own: https://opencodex.me/reference/proxy-formats/ documents the undeclared_tool_call fail-closed refusal on every wire, and #8871/#8563 define the combo failover contract this refusal currently bypasses.
Suggested mapping or implementation notes
Some combination of:
- Teach
comboStreamPayloadCommitsOutput/ the preflight inspector that anoutput_item.addedwhose client-executed call name is undeclared per the declared catalog does not by itself commit the turn — it never reaches the client. - Surface the client-boundary guard's
onRefusalinto the combo failure decision (mirror whatever wiring reportsREQUIRED_TOOL_CONTRACT_CODE), socomboFailureDecisioncan classify it; extend the hop vocabulary insrc/combos/failover.tswith caller-supplied provenance only — never bare message words alone, mirroring the envelope-walk rigor ofisUnofferedToolCallRefusalso quoted or reflected prose stays terminal.
Secondary, cheap, independent: when the refused name matches an item already in the request's input items, include that item's index/type in the refusal details — it distinguishes "provider broke the tool contract" (report to provider) from "model hallucinated a name from context" (restructure the turn), which is what an operator needs.
Additional context and attachments
A fix is in progress and will be linked as a PR on this issue. Happy to run any diagnostic on this rig; proxy, ledgers (~/.opencodex/usage.jsonl), and Codex journal are intact. Related: #8563, #8871, #9040 (dotted-alias echo shape — same family of provider echo behaviour the guard normalizes).
Checks
- I searched existing provider and compatibility issues.
- The request and response were redacted.
- The expected behaviour is based on an upstream specification or a concrete client requirement.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 814
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
bug gui platform
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
lidge-jun/opencodex#9172 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log linePossibly taken @EnesKartal claimed this 4 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidge-jun/opencodex#9057 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersPossibly taken @sedoll claimed this 6 days ago. Opencatalog provider provider-compatibility
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lidge-jun/opencodex#9037 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug cli
Difficulty 4/5 3-5 days Newbie friendliness 52/100
lidge-jun/opencodex#9171 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
account-pool enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
manually bump balena-preload to ^19.0.6Possibly taken @shaunmulligan claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
balena-io/balena-cli#3200 ·
Maintainers usually reply within 1 day
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMPossibly taken @olegius88 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melgarafael/DeskcommCRM#5340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
Maintainers usually reply within 1 day