responses: no policy surface for the client tool protocol — handling is inferred from provider templates instead of the routed call
Is it a request payload issue? [ ] Yes, this is a request payload issue. I am using a client/cURL to send a request payload, but I received an unexpected error. [x] No, it's another issue.
If it's a request payload issue, you MUST know N/A — the request is well-formed. The problem is that the proxy has nowhere to express "how should the tool protocol be handled on this route", so it guesses from templates and provider type.
Describe the bug
Summary
There is no configuration surface and no runtime resolver for the Responses client tool protocol. Any future handling would have to be decided either globally or by hardcoding a provider list. Both are wrong: the correct answer depends on the actual routed call — the selected provider, the auth kind, the real upstream model, the actual target protocol, and the endpoint — none of which are visible when a model alias is resolved to a template. Worse, a per-model flag in models.json would create a second source of truth that can disagree with runtime routing.
Observed behavior
- Whether a route can complete a client
tool_searchround trip is decided by template metadata and provider name, not by the route that will actually be used. A public alias is therefore advertised as searchable even when the credential/model that would serve it cannot close the loop — the client then sends the protocol and the request fails at the far end. - The converse also happens: a route that could bridge is left on native passthrough and silently drops discovery, because speaking the Responses wire format is treated as sufficient.
xaiis the case we observed — its executor strips thetool_searchbuilt-in, so a native passthrough loses the discovery entry point without any error. That came from the PR author's own testing; no request sample is attached here. - There is no way for an operator to disable a lossy adaptation for one route, or to opt a route into one, without a code change.
Root cause chain
internal/client/codex/models/models.gobuilds the client model catalog fromcodex_client_models.jsontemplates plusapplyCodexClientProviderCapabilities, which derives capability flags fromProvidersForModel— a provider name set, not a route.internal/confighas norequests.responses-toolssection, so nothing downstream can receive a policy at all.- Nothing in
sdk/cliproxy/authcaptures the resolved route (provider + auth kind + upstream model + executor format + base URL) into a comparable value, so even a policy engine would have nothing to match against.
CLI Type All providers.
Model Name All models. The defect is most visible on public aliases that fan out to several credentials or model pools with different capabilities.
LLM Client
Codex-style clients that read supports_search_tool from /v1/models and switch between the deferred-tool and the eager-tool request shape.
Request Information
N/A — this is a configuration and routing concern, not a payload defect. The observable symptom is in the model catalog served to the client:
curl -s http://127.0.0.1:8317/v1/models | jq '.data[] | select(.id=="gpt-5.6") | {id, supports_search_tool}'
# advertised true, while the credential that actually serves gpt-5.6 strips
# tool_search upstream -> the client's first tool_search call can never be answeredExpected behavior
Exactly one configuration source,
requests.responses-tools, with no second policy inmodels.json, model aliases, or plugin YAML. An absent block is a supported configuration and applies the convention defaults.Route rules match the call the runtime actually makes, never the name the client typed. Required exact conditions:
provider,auth-kind,upstream-model,upstream-format; plusbase-urlfor API-key routes so the same provider/model on two endpoints cannot share a rule. OAuth routes leavebase-urlempty. No wildcards, no regex, no inference from model names.upstream-formatis the target format the selected executor declares, not a value derived from the provider name. The mapping below is what the executors declare today, recorded here so a rule author knows what to write — it is documentation, not a code-enforced lookup, and it changes whenever an executor changes its target format:providerupstream-formatcodex,xai,metacodexclaudeclaudegemini,vertex,aistudiogeminikimiopenaiantigravityantigravityopenai-compatible-<name>openaiConvention over configuration: the effective policy is derived from the upstream format and the provider when no rule matches.
client-search: nativeonly where the provider forwards thetool_searchbuilt-in unchanged;bridgeeverywhere else.metais the one provider that needs a portable tool surface today, because its upstream rejectstype: customand requires every property to be listed inrequired.Lossy strategies are never inferred; they stay opt-in. The single exception is the portable-surface folding for
meta, whose upstream accepts nothing else.A
matchcondition naming a provider, auth kind, model, or format the call does not have never errors — the rule simply does not match, and the convention applies. A misspelled strategy enum does error, at config load: unknownclient-search/custom-tools/custom-grammar/local-refs/search-requiredvalues, missing required match conditions, anapi-keyrule withoutbase-url, and abase-urlcarrying userinfo, a query, or a fragment are all rejected before the config is accepted.Overlapping rules with conflicting strategies are rejected at load time; a dynamic conflict at routing time returns an explicit configuration error, never a silent first match.
Hot config updates replace the compiled policy and refresh limits without resetting already-counted usage or evicting in-flight attempts. An invalid reconfiguration keeps the previous policy: a partial route table is never published before budget validation completes.
A single emergency gate
enabled: falseturns the whole feature off without deleting anything else.
Screenshots N/A.
OS Type
- OS: macOS
- Version: 26.x / arm64 (not platform specific)
Additional context
Scope in this issue
internal/config: therequests.responses-toolsblock (enabled gate, limits, routes[] with the match conditions and theclient-search/custom-tools/custom-grammar/schemastrategy enums), load-time validation, and v8 migration handling.- Compile-time validation: unknown enum values, illegal strategy combinations, non-positive or unreasonable limits (negative never means unlimited), and statically conflicting rule overlaps are rejected.
NormalizeBaseURLfor endpoint comparison (lowercase scheme and host, default ports dropped, no trailing slash, path case preserved).- Runtime resolution: build the route identity from the selected credential and executor format, read only non-sensitive endpoint metadata, and never let keys or tokens enter the policy path.
- Strategy enums:
client-search=inherit|native|bridge|disabled;custom-tools=inherit|native|function|strip|reject;custom-grammar=reject|describe;schema.complete-search-required= tri-state;schema.local-refs=preserve|inline. - Tri-state semantics: an absent
schemastrategy follows the route convention, andschema.local-refsandschema.complete-search-requiredresolve independently — stating one does not opt the route out of the other.
Out of scope
The bridges themselves, the capability aggregation that turns this into supports_search_tool, and any change to existing executors. This issue lands the policy surface and its resolver only.
Related issues
Depends on the contract/identity representation. Feeds the search bridge, the custom bridge, the portable-surface folding, and the capability-declaration issue in this series.
Source: router-for-me/CLIProxyAPI