Repository navigation
feat(tools): promote discovered tools only on execute - #1226
TheGreatAxios merged 3 commits into
Conversation
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review
Contracts hold: tool_search is cards-only, promote-on-execute declares a single called name, optional limit defaults to 5 (cap 20), core/pinned prefix stays frozen. No blocking defects.
Should-fix
list_dir is in UNADVERTISED_MOUNTED_BUILTINS (search still hides it; “use glob”). The new intercept promotes any registered unadvertised name, so a model that emits list_dir flushes that schema onto the wire until fold. Fix in the intercept/promoter (refuse or dispatch without flushPromotions), not in search.
Nits
src/tui/runner/mcp.tsstill says MCP tools stay blind untiltool_searchpromotes them.- Numeric-string
limit: "8"silently falls back to 5 (arktype fail → default).
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review (32bedf8a)
Shippable. list_dir stays off computeAdvertised on execute and still dispatches. MCP promote-on-execute remains single-name. No blocking defects.
Intercept, exec promoter, and flushPromotions all refuse UNADVERTISED_MOUNTED_BUILTINS. Targeted tests 128 pass.
File-for-later (pre-existing, not this commit): closed exec overlays that pass BUILD_TOOLS as builtInPrefix can still project list_dir onto the wire without execute.
Search returns cards only. A call declares that one name, then dispatches.
Promote-on-execute flushed any registered unadvertised name, so a list_dir call put its schema on the wire until fold. Search already hides that builtin in favor of glob; dispatch it without advertising.
32bedf8 to
d677b90
Compare
Search no longer grows the advertised set. The late-dispatch harness now uses the same call-gate promoter as TUI and exec so schemas land on the next infer.
Summary
tool_searchreturns name + description cards only and does not grow the advertised tool set.pruneIdlePromotions).Verification
bun test src/agent/tool-search.test.ts src/tui/dynamic-tool-runner.test.ts src/exec/runner.test.ts src/session/assemble-runtime.test.ts src/tui/mcp-view.test.ts— 139 pass, 0 failbun run typecheck— exit 0Fixes CL-9488