fix(agents): compact lean local tool catalogs#88822
Conversation
|
Codex review: found issues before merge. Reviewed June 1, 2026, 12:21 AM ET / 04:21 UTC. Summary PR surface: Source +34, Tests +137, Docs +2. Total +173 across 7 files. Reproducibility: no. high-confidence live reproduction for the broader Windows/Ollama issue is included; the PR body says live Ollama model-family validation was not tested. Source inspection does show the current-main behavior and the PR’s proposed lean-mode default path clearly. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one maintainer-approved lean-mode design: either accept this experimental default as the intended upgrade behavior or gate it behind explicit opt-in/default-preserving behavior, then align the related lean-mode PRs around that decision. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction for the broader Windows/Ollama issue is included; the PR body says live Ollama model-family validation was not tested. Source inspection does show the current-main behavior and the PR’s proposed lean-mode default path clearly. Is this the best way to solve the issue? Unclear as a final fix: the implementation uses the existing Tool Search owner boundary and preserves explicit operator config, but making this the default for existing lean users needs a maintainer upgrade decision and coordination with related PRs. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against b2a1c5caa854. Label changesLabel justifications:
Evidence reviewedPR surface: Source +34, Tests +137, Docs +2. Total +173 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
991ca72 to
7bd90c6
Compare
4b59386 to
967cc13
Compare
967cc13 to
1e2991d
Compare
1e2991d to
6153fb5
Compare
|
Land-ready after refresh on Verification run before merge: node scripts/docs-list.js
node scripts/check-docs-mdx.mjs docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.md
node scripts/format-docs.mjs --check docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.md
node_modules/.bin/oxfmt --check --threads=1 docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.md src/agents/local-model-lean.ts src/agents/local-model-lean.test.ts src/agents/embedded-agent-runner/run/attempt.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts
node scripts/run-oxlint.mjs src/agents/local-model-lean.ts src/agents/local-model-lean.test.ts src/agents/embedded-agent-runner/run/attempt.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts
git diff --check origin/main...HEAD
TMPDIR=$PWD/.tmp/vitest-88822 OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/local-model-lean.test.ts --reporter=dot
TMPDIR=$PWD/.tmp/vitest-88822 OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts --reporter=dot --testNamePattern 'defaults local-model lean embedded runs|keeps Tool Search controls off for lean message-tool-only delivery'
.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainFresh GitHub checks passed on this SHA: CI Known gap: local AWS Crabbox broker auth is missing on this machine, so I did not rerun AWS Crabbox for the refreshed head. The fresh GitHub matrix covered the remote proof before merge. |
Summary
localModelLeanruns to structured Tool Search controls when the operator has not configuredtools.toolSearchtools.toolSearch: falsemessagedelivery semantics formessage_tool_only/ forced-message runs instead of hiding that tool behind Tool Searchtool_search,tool_describe, andtool_callexcept for direct message delivery runsRefs #86599
Verification
6153fb5ecb47e01a546af38c8c4b1b7286a77337after rebasing ontoorigin/main5c5391836b1eaca048f7ae9ef0b72333b90169ef.node scripts/docs-list.jspassed.node scripts/check-docs-mdx.mjs docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.mdpassed.node scripts/format-docs.mjs --check docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.mdpassed.node_modules/.bin/oxfmt --check --threads=1 docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.md src/agents/local-model-lean.ts src/agents/local-model-lean.test.ts src/agents/embedded-agent-runner/run/attempt.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.tspassed after formatting the rebasedattempt.tsimport ordering.node scripts/run-oxlint.mjs src/agents/local-model-lean.ts src/agents/local-model-lean.test.ts src/agents/embedded-agent-runner/run/attempt.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.tspassed.git diff --check origin/main...HEADpassed.TMPDIR=$PWD/.tmp/vitest-88822 OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/local-model-lean.test.ts --reporter=dotpassed, 1 file / 11 tests.TMPDIR=$PWD/.tmp/vitest-88822 OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts --reporter=dot --testNamePattern 'defaults local-model lean embedded runs|keeps Tool Search controls off for lean message-tool-only delivery'passed, 2 files / 4 focused tests run / 116 skipped..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainreportedautoreview clean: no accepted/actionable findings reported,overall: patch is correct (0.83).6153fb5: CI27111011466, CodeQL/Security High27111011468, CodeQL Critical Quality27111011471, OpenGrep PR Diff27111011476, Real behavior proof27111014608, Dependency Guard27111010702, Workflow Sanity27111011460.Real behavior proof
Behavior addressed: smaller/local-model runs can keep large extra tool catalogs out of the direct prompt surface without disabling tools entirely, while message-tool-only delivery still keeps the direct
messagetool visible.Real environment tested: linked OpenClaw gwt worktree plus fresh GitHub CI on the refreshed PR head.
Exact steps or command run after this patch: focused lean-mode and embedded-attempt Vitest proof, docs list, docs MDX, docs formatting, oxfmt, oxlint, diff-check, local autoreview, and the fresh GitHub CI/check matrix listed above.
Evidence after fix: local focused tests covered the default lean Tool Search path, explicit
tools.toolSearch: false, andsourceReplyDeliveryMode: "message_tool_only"preserving the direct message tool. GitHub CI also passed the selectedagent-runtime-boundarycritical shard, agent embedded/core/runtime shards, docs checks, type checks, lint, guards, security high scans, OpenGrep changed-path scan, and real-behavior-proof workflow.Observed result after fix: lean-mode embedded runs enable Tool Search controls by default for normal runs, preserve explicit operator config, pass the resolved Tool Search config into core, OpenClaw, MCP, and client catalog construction, and skip the lean default when direct message delivery is forced.
What was not tested: live Ollama model-family validation for the broader local-model issue. AWS Crabbox proof was not rerun from this machine because the AWS broker login is missing here; GitHub CI supplied the remote proof for this refreshed head.