Repository navigation
feat(agents): show searchable tool capabilities automatically - #114508
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 6:24 AM ET / 10:24 UTC. ClawSweeper reviewWhat this changesAdds an automatic, bounded directory of trusted searchable tool capabilities to agent system prompts when Tool Search is enabled, with documentation and gateway-fixture coverage. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open for maintainer review. It makes a new default agent-prompt behavior—automatically adding a bounded searchable-capability directory—and the supplied evidence is strong on mocked/runtime test coverage but does not include inspectable after-fix real-provider proof. Likely related people: steipete is the available low-confidence routing candidate as the feature author. Priority: P2 Review scores
Verification
How this fits togetherEmbedded agent runs assemble a system prompt from the enabled tool configuration and policy-filtered tool catalog before sending a request to a model provider. Tool Search replaces many direct schemas with compact discovery controls; this PR also gives the model a safe summary of capabilities it can discover. flowchart LR
A[Agent run] --> B[Tool Search settings]
B --> C[Policy-filtered tool catalog]
C --> D[Bounded capability directory]
D --> E[Stable system-prompt prefix]
E --> F[Model provider]
F --> G[Tool Search bridge]
G --> H[Authorized tool call]
Decision needed
Why: This is a deliberate new default for existing configured users and changes agent context allocation and model guidance; tests can verify mechanics but cannot select the product default. Before merge
Agent review detailsSecurityNone. PR surfaceSource +51, Tests +238, Docs +15, Other +3. Total +307 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm that an automatic bounded capability directory is the intended default for all enabled Tool Search modes, then attach a redacted live-provider or provider-request artifact demonstrating the safe directory and successful discovery path before merge. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new capability-discovery behavior rather than reporting a currently failing user workflow. The supplied tests and gateway fixture describe the intended behavior but are not a bug reproduction. Is this the best way to solve the issue? Unclear: the implementation is a coherent bounded, policy-filtered approach, but whether it should be automatic for every existing Tool Search configuration is a maintainer product decision rather than a purely technical fix. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 50dee059a254. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Addressing the latest ClawSweeper rank-up moves before landing:
Final proof: 322 focused tests across 14 files; full |
|
Merged via squash.
|
What Problem This Solves
When Tool Search is enabled, the default code and structured modes previously hid the real catalog without telling the model which capabilities it could discover. Models had to guess when search was useful, even though the Gateway already knew the policy-filtered catalog.
Why This Change Was Made
Automatically render the existing trusted, policy-filtered capability directory for every enabled Tool Search mode. Keep it bounded to 18,000 characters, alphabetically deterministic, above the explicit system-prompt cache boundary, and memoized by immutable catalog snapshot. Use mode-correct search guidance and never copy untrusted MCP or client names, descriptions, or schemas into the prompt. Keep direct-only tools, disabled Tool Search, Codex-native dynamic tools, approvals, hooks, and local-model runtime configuration unchanged.
User Impact
Models immediately know which authorized OpenClaw and plugin capabilities are searchable without receiving every full tool schema. Repeated turns preserve KV-cache prefix reuse, and the model still learns that policy-approved MCP and client capabilities can be discovered safely.
Evidence
tool-search-gateway-e2epasses with 68 direct tools versus 2 compact tools; the hidden target is present in the compact directory and absent from the direct-mode directory; both modes call the same real plugin tool.pnpm check:changed: all TypeScript, core and plugin lint, security, architecture, dependency, and boundary guards pass; zero runtime import cycles.pnpm check:docs: 737 Markdown files clean, 752 MDX files validated, zero broken links, and generated docs map up to date.