feat(web): ToolSearch verification UI (panel row + parsed-result card variant) - #44
Conversation
…ard variant The Runtime panel gains a 'tool search' row from /config.toolSearch (null renders as 'off'), with a tooltip stating the honest boundary: this is the configured value; actual per-turn activation shows as a ToolSearch call in the stream. That call now renders as a card variant: search icon, the query as summary line, and a parsed 'Matched tools' list from the CLI's <functions> result block. Parsing is best-effort (parseToolSearchResult): unparseable entries are skipped and when nothing parses the card falls back to the raw text — an unexpected shape never render-fails (the block format is a CLI-internal contract). Pure client-side change; new DTO field optional so the playground degrades gracefully against older runtimes. Verified in a browser against a deterministic fake runtime emitting both a well-formed <functions> result and a plain-text fallback result. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aafd17c2a4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| {cfg.toolSearch !== undefined && ( | ||
| <Row | ||
| k="tool search" | ||
| v={cfg.toolSearch ?? "off"} |
There was a problem hiding this comment.
Render unset tool search as unset, not off
When RUNTIME_TOOL_SEARCH is unset but a bare ENABLE_TOOL_SEARCH exists in the runtime environment, the runtime intentionally leaves the child env untouched; the test at apps/runtime/test/runtime.test.ts:709-716 asserts that this passthrough still enables values like auto:3, and the README documents /config.toolSearch null as unset/default. Rendering that null as off makes the Runtime panel report tool search as disabled even though the next turn may still use it via ENABLE_TOOL_SEARCH or the CLI default, which undermines this verification UI; please show an unset/default state instead of off.
Useful? React with 👍 / 👎.
…unset knob as 'default' Review SHOULD-FIXes, both adversarially confirmed against evidence: 1. The CLI returns ToolSearch matches as tool_reference content blocks (verified across 182 real tool_result payloads in local CLI transcripts, 2.1.183-2.1.199, bracketing the pinned 2.1.197) — the <functions> block only exists in the API's server-side expansion for the model, so the previous parser never matched on the real wire and the card always fell back to raw JSON. parseToolSearchResult now parses the stringified tool_reference array as the primary shape and keeps the <functions> parser as a defensive fallback. 2. /config.toolSearch null means 'unset -> the CLI decides' (which can be ON for official backends, and a bare ENABLE_TOOL_SEARCH passthrough is invisible to /config), so rendering it as 'off' actively misled; it now renders as 'default', matching the skills row's convention, with the tooltip spelling out the semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Independent pre-merge review (3 lenses: correctness / UI-consistency / scope-tests-docs, each material finding adversarially verified): 0 BLOCKER, 2 SHOULD-FIX confirmed — both fixed in
NITs recorded (not fixed): duplicate |
What
v0.13.0 slice 2 (W4, final slice of the approved extensibility roadmap): the playground's tool search verification UI, pairing with #43's runtime knob.
tool searchfrom/config.toolSearch;nullrenders asoff(e.g. the graceful-degrade state on the MiniMax backend). Tooltip states the honest boundary: this is the configured value; whether a turn actually used tool search is observable only as aToolSearchcall in that turn's stream.queryas the summary line, and a parsed Matched tools · N list (name + description) from the CLI's<functions>result block (<function>{…json…}</function>per tool, format verified against the CLI binary).parseToolSearchResultis best-effort: unparseable entries are skipped; when nothing parses the card falls back to the raw result text. The block format is a CLI-internal contract, so an unexpected shape must degrade, not break the stream.Why
Completes the plan's verification story for tool search: the panel shows what is configured, the card shows what actually happened. Pure client-side; the SSE contract and runtime are untouched, and the new DTO field is optional so the playground degrades gracefully against older runtimes.
Verification
parseToolSearchResult(well-formed block, surrounding prose, partial-parse, missing/invalid name, raw-text fallback, null/empty).biome ciclean on changed files;pnpm -r typecheck/ web tests (57) / build all green.tool search auto; a turn renders two ToolSearch cards — one parsing toMatched tools · 2(mcp__demo__ping/mcp__demo__pongwith descriptions), one falling back to raw text; v0.12.0 regressions checked (Task-card nesting, orphan-parent visibility, subagent-delta drop, MCP badges, error card); zero console errors across two passes including a fresh page load.🤖 Generated with Claude Code