fix(agents): validate extension tool names#89149
Conversation
|
Codex review: found issues before merge. Reviewed June 27, 2026, 6:53 AM ET / 10:53 UTC. Summary PR surface: Source +20, Tests +71. Total +91 across 2 files. Reproducibility: yes. source-reproducible: current main reads extension Review metrics: 1 noteworthy metric.
Stored data model 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: Choose and land one canonical malformed extension-tool metadata policy across the open branches, with tests proving either intended whole-extension rejection or per-tool quarantine behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main reads extension Is this the best way to solve the issue? No, not yet as a merge decision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c5d34c8376f8. Label changesLabel justifications:
Evidence reviewedPR surface: Source +20, Tests +71. Total +91 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
|
|
This looks like the right boundary to fail closed. One thing I noticed while reading the helper: |
|
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
nameaccessorsVerification
node scripts/run-vitest.mjs src/agents/sessions/extensions/loader.test.ts --reporter=dotnode_modules/.bin/oxfmt --check src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.tsnode_modules/.bin/oxlint src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode local.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainnode scripts/crabbox-wrapper.mjs run --provider aws --idle-timeout 90m --ttl 240m --timing-json --shell -- "env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed"(run_8fd80c3ac42a,cbx_3db5b164cc01, provideraws, exit 0)Real behavior proof
Behavior addressed: a malformed local session extension can no longer register a tool with a non-string or unreadable name and leave a poisoned entry for later session/runtime paths.
Real environment tested: focused local Vitest on Node 24 plus AWS Crabbox Linux changed gate.
Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/sessions/extensions/loader.test.ts --reporter=dot;node scripts/crabbox-wrapper.mjs run --provider aws --idle-timeout 90m --ttl 240m --timing-json --shell -- "env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed".Evidence after fix: focused Vitest passed 3 tests; Crabbox changed gate selected
coreandcoreTests, completed typecheck/lint/guards, and exited 0 in runrun_8fd80c3ac42aon leasecbx_3db5b164cc01. After one final fast-forward rebase, focused Vitest, oxfmt, oxlint, andgit diff --checkwere rerun on pushed headf372abd07e48f167d80e65efb8b01c6b3c4affc4.Observed result after fix: invalid extension tool names now reject the extension through
loadExtensions().errorswith a clear registration message instead of inserting malformed tool entries.What was not tested: full repository suite on the pushed SHA; GitHub PR checks are expected to cover the final branch head.