Skip to content

docs(tool-search): configuration by client, one Responses row - #950

Merged
amiddavid merged 2 commits into
mainfrom
docs/matrix-config-doc
Nov 8, 2026
Merged

amiddavid merged 2 commits into
mainfrom
docs/matrix-config-doc

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

Docs only. No code change, no behavior change, no data dependence change.

What changed

All in docs/tool-search-matrix.md:

  • New section "Configuration by client". One short subsection each for Claude Code (ToolSearch on, and off), Codex, a Chat Completions client, and a Responses client with no search. Each has: how to turn it on, client-side settings, how to turn deferral off, and which /stats tool_defer fields to watch. It has one shared toolfilter table (defer, keep, always_defer) and a YAML example.
  • Two Responses rows merged. The row "gpt-5.6 and later | OpenAI's server-side search | Not built yet" contradicted the row above it. Now one row says such a client uses context_guru_tools on any model. A "Planned, not built" note says OpenAI's server-side search is planned in feat(tooldefer): native tool search for gpt-5.6+ on the Responses API #876.

How it was checked

Each name was found with git grep on origin/main:

  • defer, keep, always_defer: components/reformat/toolfilter.go, config/config.go (ultrahigh block), proxy/savemoretools.go
  • ultrahigh preset, --preset / PRESET: config/config.go, cmd/context-guru-proxy/main.go, docs/reference/presets.md
  • Preset picker, settings.py preset set --name: context-guru-plugin/skills/preset-picker/SKILL.md; Codex picker under codex-marketplace/plugins/context-guru/skills/preset-picker
  • ENABLE_TOOL_SEARCH (false/0/no/off): context-guru-plugin/scripts/signal.sh, tooldefer/gate.go
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS: apply/breakpoint.go, plugin costly_settings.json
  • WebSocket upgrade answered with 426: proxy/proxy.go (StatusUpgradeRequired)
  • input_not_array, native_search, previous_response_id: tooldefer/clientsearch.go
  • /stats fields client_search_disabled, client_loads, direct_calls, requests, retries_400, turned_off, add_backs, wrong_guesses: proxy/tooldefer.go

No new page, so mkdocs.yml is unchanged.

Left out

  • supports_websockets: not in the code. The page names the 426 answer without the Codex setting.

Add a "Configuration by client" section to the tool search matrix.
Merge the two contradicting Responses rows into one, and note that
OpenAI's server-side search is planned in #876.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.319 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 33df32edccea blocking

Verdict: blocking

Findings

  1. docs/tool-search-matrix.md:16 — "any model" is wrong: a Responses request that names a Claude model defers nothing and gets no search tool
    • What fails: a reader routes Claude models through the OpenAI Responses endpoint (a litellm-style gateway allows it) and reads this row. The row says the proxy adds context_guru_tools and defers "tools the history rule picks" for any model. In the code, ApplySearch stops on a Claude model name before it looks at the tools: case AnthropicModel(r.Model): o.Why = "anthropic" (tooldefer/clientsearch.go:324). The Claude path (Apply) never runs for the Responses wire, because the host gates it on wire != schema.WireAnthropic || provider != bschemas.Anthropic (proxy/tooldefer.go:400), and /openai/v1/responses is wired with provider OpenAI (proxy/proxy.go:524-527). So such a request defers nothing, and the model gets no way to load a tool. The same wrong claim repeats at docs/tool-search-matrix.md:107-108: "The proxy checks the tools in the request, not the model name."
    • Proof: trace above. The row below it in the same file (docs/reference/presets.md:182) says the removal path is for "GPT, GLM and Kimi", which matches the code.
    • Fix: write "any non-Claude model" in the row, and add one line to the Responses section: a Claude model on this wire defers nothing (it is left to the Anthropic path, which the Responses wire never takes).

Non-blocking

  • docs/tool-search-matrix.md:60 and :111: "or leave ultrahigh" reads as "or keep ultrahigh", the opposite of the intent ("or switch away from ultrahigh"). Line 157 (old text) has the same phrasing. Suggest "or use a lower preset".
  • docs/tool-search-matrix.md:88: "Codex falls back to HTTP at once". The code comment says HTTPS (proxy/proxy.go:528-531). Pick one word and keep it.

What I checked

  • The full diff (one commit, docs/tool-search-matrix.md only, +98/-2) and the whole file around it.
  • Preset facts: ultrahigh = xhigh + toolfilter defer: auto, no other preset defers (config/config.go:670-673, :964-966); --preset flag and PRESET env (cmd/context-guru-proxy/main.go:85); the YAML example merges per component with the user block winning (config/config.go:465-472), and the example includes defer: auto, so it is correct.
  • toolfilter keys: defer (auto/off, default off), keep, always_defer, keep wins over always_defer, mcp__<server> names (components/reformat/toolfilter.go:35-41, :86-112; matching in tooldefer/tooldefer.go:152-191).
  • Stats labels named in the doc: requests, retries_400, turned_off, add_backs, wrong_guesses, client_loads, direct_calls, client_search_disabled (unknown_description, break) — all present in the /stats tool_defer block (proxy/tooldefer.go:748-790, metrics/metrics.go:1101).
  • ENABLE_TOOL_SEARCH: values false|0|no|off (tooldefer/gate.go:169-175, context-guru-plugin/scripts/signal.sh:41,62); the Codex plugin's signal hook sends only session, event and kind, so the doc's "no hook that sends it" is right (codex-marketplace/.../codex_plugin.py:594-614).
  • Codex: WebSocket upgrade gets 426, other GETs keep 405 (proxy/proxy.go:528-536); own tool_search means nothing deferred (NativeSearch, tooldefer/clientsearch.go:327,712-723); the Codex preset picker exists (codex-marketplace/.../codex_plugin.py:792-794, skills/preset-picker).
  • Responses path: string input → input_not_array; previous_response_id with no record makes no new decision (tooldefer/clientsearch.go:346-363).
  • Probe gating: a new decision on a Claude model needs a Pass verdict, else the thread defers nothing, so "the first session after the change defers nothing" is right (tooldefer/apply.go:139-185); the Chat Completions path has no probe (proxy/tooldefer.go:492-494).
  • Cross-checked the claims against docs/reference/presets.md:182, which agrees with the code except where the finding says so.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.319 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 33df32edccea blocking

Verdict: blocking

Findings

  1. docs/tool-search-matrix.md:16 — the new "any model" claim on the Responses row is wrong for Claude models
    • What fails: a Responses request whose model name contains "claude" (for example Codex pointed at a Claude model through an OpenAI-compatible upstream) gets no search tool and no deferral. The row says such a client gets our context_guru_tools, for "any model", because "the proxy checks the tools, not the model".
    • Proof: the dispatch sends every Responses request to the client-search path only (proxy/tooldefer.go:398-401); the defer_loading path requires wire == WireAnthropic && provider == Anthropic (proxy/tooldefer.go:402-404), so it never runs on a Responses wire. Inside ApplySearch, the model check runs before the tools check: case AnthropicModel(r.Model): o.Why = "anthropic"; return o, nil (tooldefer/clientsearch.go:324-326), and AnthropicModel matches any name containing "claude" (tooldefer/probe.go:341-343). NativeSearch, the tools check, is the next case (tooldefer/clientsearch.go:327). So for a Claude model the proxy checks the model, not the tools, and defers nothing. The sibling Chat Completions row avoids this by naming its models ("GLM, Kimi, GPT chat"); the Responses row now claims "any model".
    • Fix: scope the row and the section bullet (lines 107-108) to non-Claude models — for example "any model but Claude" — or add a sentence saying a Claude model on a Responses wire defers nothing today. Note: the parenthetical "checks the tools, not the model" predates this PR; the "any model" wording is what this PR adds.

Non-blocking

  • Line 23: "All four setups" — five subsections follow (Claude Code on, Claude Code off, Codex, Chat Completions, Responses). Say "four clients" or "five setups" so the count matches what the reader sees.
  • Line 66: "retries_400: ... 400s that the proxy retried with the original" — the counter also books 422s (proxy/tooldefer.go:615, "a 400 or 422"). The field name says 400; one word ("400/422") would make it exact.
  • Line 60: "Turn off: toolfilter: {defer: off}, or leave ultrahigh" — "leave" reads two ways ("keep" or "depart from"). "Or switch off ultrahigh" is unambiguous.
  • Line 109: "Client setting: the request input must be an array" — this is a request shape, not a client setting. The other bullets in that slot name real settings.

What I checked

  • Read the full diff (one file, docs/tool-search-matrix.md, +98/-2) and the whole file around it.
  • Verified against the code, line by line:
    • toolfilter keys defer/keep/always_defer, off as the default, keep winning over always_defer (components/reformat/toolfilter.go:35-40,86-112; tooldefer/tooldefer.go:188-207 — veto beats always in the switch).
    • ultrahigh = xhigh plus defer: auto, and no other preset defers (config/config.go:670-673,964-992; only one defer: in the preset YAMLs).
    • --preset flag and PRESET env var (cmd/context-guru-proxy/main.go:85); preset: YAML key (config/config.go:27); user component config overrides the preset's per-component node, so the example correctly repeats defer: auto (config/config.go:455-464).
    • Preset picker: skill exists, runs settings.py preset set --name <name>; its own text matches "the first session on each model after the restart is not deferred".
    • Probe gating: first request with no verdict defers nothing for that thread (tooldefer/apply.go:164-178); the client-search path has no probe, so its first request can defer (proxy/tooldefer.go:474-475).
    • ENABLE_TOOL_SEARCH values false/0/no/off (tooldefer/gate.go:169-175); the session-start hook sends it (context-guru-plugin/hooks/hooks.json, scripts/signal.sh:41,62); the Codex plugin has no ENABLE_TOOL_SEARCH anywhere.
    • Codex: WebSocket upgrade answered with 426 (proxy/proxy.go:528-535); native tool_search defers nothing (tooldefer/clientsearch.go:327-332); Codex preset picker exists.
    • Responses: input_not_array and previous_response_id reasons and their behavior (tooldefer/clientsearch.go:341-363).
    • Every /stats tool_defer field named in the doc: requests, retries_400, turned_off, add_backs, client_loads, direct_calls, wrong_guesses, client_search_disabled with reasons unknown_description/break (proxy/tooldefer.go:748-791; tooldefer/gate.go:50-51).
  • Live tests were not run (not approved). This is a docs-only change: no data-dependence row and no behavior-change note are needed.

- Say "non-Claude model": a Claude model on the Responses wire defers nothing.
- Fix the setup count, "400 or 422", "use a lower preset", "HTTPS",
  and relabel the `input` rule as a request shape.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round 1 fixed in 94d8a00.

  1. "any model" (blocking): the row now says "any non-Claude model (the proxy checks the model name, then the tools)". The Responses section has a new "Claude models" line: a Claude model on this wire defers nothing today.
  2. Count: "All five setups".
  3. retries_400: "400s and 422s" and "a 400 or 422" in the three places.
  4. "or leave ultrahigh": now "or use a lower preset" (2 places).
  5. Line 109: relabeled "Request shape".
  6. HTTP: now "HTTPS".

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.319 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 94d8a0047643 approve

Verdict: approve

Findings

None. The round-1 finding is fixed and correct.

Round-1 findings, re-checked

  1. "any model" wrong for Claude models on the Responses wire (mine, and reviewer 2's finding 1 — same defect).
    • Fixed. The row now says "any non-Claude model (the proxy checks the model name, then the tools)". That matches the code order exactly: AnthropicModel first, NativeSearch second (tooldefer/clientsearch.go:324-327). The Responses section adds "Claude models: a Claude model on this wire defers nothing today. The defer_loading path does not run on Responses." — also correct: the defer_loading path needs wire == WireAnthropic && provider == Anthropic (proxy/tooldefer.go:402-404).
    • Reviewer 2's fix proposal was the same as mine. Both are answered by the same two edits.

Non-blocking notes from round 1, re-checked

  • "All four setups" → "All five setups". Fixed. Five subsections follow.
  • retries_400 "400s" → "400s and 422s" / "a 400 or 422" in all three places. Fixed. Matches deferRetry, which books "a 400 or 422" (proxy/tooldefer.go:615).
  • "or leave ultrahigh" → "or use a lower preset" in both places. Fixed.
  • "Client setting: the request input..." → relabeled "Request shape:". Fixed.
  • Reviewer 2's "falls back to HTTP" → "falls back to HTTPS". Fixed. The code comment says "Only 426 Upgrade Required makes it fall back to HTTPS at once" and the error text says "use HTTPS POST" (proxy/proxy.go:529-535).

Non-blocking

  • The table has no row for a Claude model on a Responses wire; only the section text covers it. A reader who reads only the table misses that case. A short row, or a pointer under the table, would close it.
  • "A 400 or 422 on a deferred request turns deferral off for the tenant and model" — the code turns deferral off only when the original request then succeeds; when the original fails too, deferral stays on (proxy/tooldefer.go:615-630). The sentence is a simplification that predates this PR; this commit only widened 400 to "400 or 422".

What I checked

  • Last review: round 1, 33df32e, 2026-11-08T13:51:19Z.
  • New commits read: 1 — 94d8a004 "docs(tool-search): fix the Responses claims from review round 1" (one file, docs/tool-search-matrix.md, +12/-12).
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt).
  • New items since my last review:
    • Reviewer 2's round-1 review (posted 67 seconds before mine, not read before mine went out): one finding, identical to mine, plus two non-blocking notes ("leave ultrahigh", HTTP vs HTTPS). I checked both notes myself: the wording one is a fair reading, and the HTTPS one matches the code comment. The author fixed both.
    • The author's comment "Round 1 fixed in 94d8a00" listing six fixes. I verified each one in the diff and against the code (see above). All six are in the commit and all are correct.
    • Commit 94d8a004: read the full diff and the changed file around each change. Every edit matches the code: the check order, the Claude-model exclusion, the five setups, the 400/422 wording, the lower-preset wording, the request-shape label, and the HTTPS wording.
  • No new code, no behavior change, no data-dependence impact. Live tests not run (not approved); not needed for a docs-only change.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.319 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 94d8a0047643 approve

Verdict: approve

Findings

None. Both round-1 findings are fixed, and the fix commit adds no new defect.

Earlier findings

  • Mine, 1 (blocking): "any model" on the Responses row. Fixed. The row now says "any non-Claude model (the proxy checks the model name, then the tools)". That matches the code order: AnthropicModel(r.Model) runs before NativeSearch (tooldefer/clientsearch.go:324-332). The section bullet now says the same, and the new "Claude models" line ("defers nothing today. The defer_loading path does not run on Responses") matches the host gate (proxy/tooldefer.go:400: the Anthropic path needs wire == WireAnthropic).
  • Reviewer 1, 1 (blocking): same defect. Fixed by the same change. I checked it myself; the proof above is mine.
  • Reviewer 1, non-blocking (count, retries_400 wording, "leave ultrahigh", "client setting" label, HTTP/HTTPS). All fixed: "All five setups" (five subsections follow), "400s and 422s" and "a 400 or 422" in the three Watch bullets, "or use a lower preset" in three places, the bullet is relabeled "Request shape", and the Codex paragraph says HTTPS, which matches the code comment (proxy/proxy.go:528-531).
  • My non-blocking ("leave ultrahigh", HTTP/HTTPS). Fixed the same way.

Non-blocking

  • The two table rows (Chat Completions and Responses) still say "A 400 turns deferral off" in the "On a break or disable" column, while the body text now says "a 400 or 422". The column text predates this PR. One word would line them up.
  • The Watch bullets say a 400 or 422 "turns deferral off for the tenant and model". The code turns it off only when the original request then succeeds; when the original fails too, deferral stays on (proxy/tooldefer.go:615-637, Break only on originalOK). The sentence is a fair simplification of the common case.

What I checked

  • Last review: round 1, 33df32e, 2026-11-08T13:50:12Z.
  • New commits read: 1 — 94d8a004 "docs(tool-search): fix the Responses claims from review round 1" (one file, +12/−12).
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files).
  • New items since my last review: the author's comment "Round 1 fixed in 94d8a00" with the six-point fix list — I checked each point against the diff and the code, as above.
  • The 422 claim: the retry path fires on 400 and 422 (proxy/proxy.go:2022-2025), and deferRetry books both into the retries_400 counter (proxy/tooldefer.go:623-637, comment at :768). The doc's new wording is right.
  • The setup count: five subsections follow the sentence (Claude Code on, Claude Code off, Codex, Chat Completions, Responses).
  • Re-read the changed sections of docs/tool-search-matrix.md in the final file, not only the diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant