fix(plugins): guard runtime tool descriptors#89253
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 1, 2026, 7:35 PM ET / 23:35 UTC. Summary PR surface: Source +168, Tests +89. Total +257 across 3 files. Reproducibility: yes. from source inspection: current main directly reads runtime plugin tool descriptor getters in resolution and cache capture paths, so a throwing getter can abort that path. I did not run the regression locally because this was a read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the guarded descriptor snapshot path after normal maintainer draft and CI review so malformed plugin tools are isolated while valid siblings remain usable. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main directly reads runtime plugin tool descriptor getters in resolution and cache capture paths, so a throwing getter can abort that path. I did not run the regression locally because this was a read-only review. Is this the best way to solve the issue? Yes; guarding descriptor reads at the plugin runtime boundary and reusing validated snapshots is narrower and more maintainable than adding downstream try/catch handling at each caller. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 4c6285e8ff79. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +168, Tests +89. Total +257 across 3 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
|
Summary
name,execute,parameters,description,label, anddisplaySummary.Verification
node scripts/run-vitest.mjs src/plugins/tools.optional.test.ts --reporter=dotnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/plugins/tools.ts src/plugins/tools.optional.test.ts src/plugins/tool-descriptor-cache.ts./node_modules/.bin/oxfmt --check --threads=1 src/plugins/tools.ts src/plugins/tools.optional.test.ts src/plugins/tool-descriptor-cache.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainrun_95ca8a20197a, leasecbx_06e2e1c4e590,corepack pnpm check:changed, exit 0Real behavior proof
Behavior addressed: Runtime plugin tools with malformed or poisoned descriptor getters are skipped with diagnostics while valid sibling tools remain available and scoped to the owning plugin.
Real environment tested: Azure Linux Crabbox run
run_95ca8a20197a, leasecbx_06e2e1c4e590, cloned branchfuzz-plugin-runtime-tool-descriptor-20260601, Nodev24.15.0.Exact steps or command run after this patch: Installed Node/Corepack on the raw box, cloned the pushed branch, fetched
origin/main, then ranenv OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed.Evidence after fix:
check:changedselectedcoreandcoreTests; typecheck, changed-file lint, import-cycle/runtime guards, and related changed-gate checks passed with exit 0.Observed result after fix: The focused regression keeps the valid
messageplugin tool, emits malformed diagnostics for poisonedname,execute,parameters, anddescriptiondescriptors, and masks poisoned optional descriptor fields to safeundefinedvalues.What was not tested: Live third-party plugin packages beyond the mocked runtime registry regression.