fix(agents): guard lean tool name reads#89730
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 6:28 AM ET / 10:28 UTC. Summary PR surface: Source +11, Tests +27. Total +38 across 2 files. Reproducibility: yes. Current main reads Review metrics: none identified. 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 detailsBest possible solution: Land the narrow guard and regression after the draft branch is refreshed against current main and the changed gate or accepted equivalent has passed. Do we have a high-confidence way to reproduce the issue? Yes. Current main reads Is this the best way to solve the issue? Yes. Guarding only the lean-filter name read is the narrowest maintainable fix because disabled lean mode still returns the original tool array and later schema quarantine cannot protect this earlier read. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 72b9bc730370. Label changesLabel justifications:
Evidence reviewedPR surface: Source +11, Tests +27. Total +38 across 2 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
|
|
Closing this fuzz-only hardening PR. The only failing state is a synthetic fixture using hostile in-process objects, throwing getters or callbacks, or similarly malformed metadata; there is no linked production report or supported external contract requiring that state. This adds broad fail-soft behavior and substantial regression surface across consumers. If a real plugin or provider demonstrates the failure, please open a focused issue with the observed payload and stack so validation can live at the single owning registration/parsing boundary. Thanks for exploring it. |
Summary
namegetter while preserving healthyread/execsiblings and filteringcron.Verification
CI=1 node scripts/run-vitest.mjs run src/agents/local-model-lean.test.ts -t "omits unreadable tool names" --reporter=verbosefailed withlocal model lean tool name getter explodedfromsrc/agents/local-model-lean.ts.CI=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=30000 OPENCLAW_VITEST_NO_OUTPUT_HEARTBEAT_MS=10000 node scripts/run-vitest.mjs run src/agents/local-model-lean.test.ts -t "omits unreadable tool names" --reporter=verbose --pool=forks --maxWorkers=1 --fileParallelism=false --teardownTimeout=1000CI=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=30000 OPENCLAW_VITEST_NO_OUTPUT_HEARTBEAT_MS=10000 node scripts/run-vitest.mjs run src/agents/local-model-lean.test.ts --reporter=verbose --pool=forks --maxWorkers=1 --fileParallelism=false --teardownTimeout=1000node --run format:check -- src/agents/local-model-lean.ts src/agents/local-model-lean.test.tsOPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs src/agents/local-model-lean.ts src/agents/local-model-lean.test.tsgit diff --check origin/main..HEAD.agents/skills/autoreview/scripts/autoreview --mode local.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainBehavior addressed: local-model lean filtering no longer aborts the assistant tool surface when a malformed descriptor has an unreadable
namegetter.Real environment tested: local focused Vitest and repo wrapper checks on the rebased OpenClaw branch.
Exact steps or command run after this patch: ran the focused regression, the full
src/agents/local-model-lean.test.tsfile, format check, scoped oxlint, diff check, private-data scrub, local autoreview, and branch autoreview.Evidence after fix: focused Vitest passed 1 file / 10 tests after rebase; format, scoped oxlint, and diff check passed; local and branch autoreview reported no accepted/actionable findings.
Observed result after fix: malformed unreadable-name tools are omitted during active lean filtering, healthy
readandexectools remain visible, and denied heavyweight tools are still removed.What was not tested: full
pnpm check:changeddid not run. The AWS Crabbox changed-gate wrapper failed before lease creation because the local sparse-sync cache had less than the required 1 GiB free even afteragent-worktree-maintain --force; Blacksmith Testbox is not authenticated in this environment. The plain oxlint wrapper was also blocked before lint by unrelated Discord boundary dts errors, so scoped oxlint was run withOPENCLAW_OXLINT_SKIP_PREPARE=1on the touched files.