fix(agents): quarantine unreadable extension tools#89406
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 7:56 PM ET / 23:56 UTC. Summary PR surface: Source +105, Tests +78. Total +183 across 3 files. Reproducibility: yes. Current main reads 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 detailsBest possible solution: Choose one canonical malformed extension-tool metadata policy across registration and session refresh, then land the selected implementation or fold this narrow patch into that branch. Do we have a high-confidence way to reproduce the issue? Yes. Current main reads Is this the best way to solve the issue? Unclear as the final policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 18b2ff683fd3. Label changesLabel justifications:
Evidence reviewedPR surface: Source +105, Tests +78. Total +183 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
Review history (1 earlier review cycle)
|
|
Closing this fuzz-only hardening PR. The failure is constructed with hostile in-process objects, throwing getters, or similarly malformed metadata; there is no linked production report or external contract requiring that state. The patch spreads fail-soft handling through consumers and adds substantial branches/tests for a synthetic case instead of validating once at the real registration or parsing boundary. If an observed plugin/provider failure demonstrates that malformed external data can cross a supported boundary, please open a focused issue with the real payload and stack. The right fix would be canonical boundary validation with diagnostics, not per-consumer fallback behavior. Thanks for exploring the surface. |
Summary
api.registerTool(...)so unreadable extension tool descriptors are skipped instead of failing the whole extension load.This is scoped to extension registration. It does not add provider-specific schema compatibility checks or doctor runtime projection validation.
Linked context
No tracked issue. Part of the tool-schema/runtime ingress fuzzing sweep.
Real behavior proof (required for external PRs)
node scripts/run-vitest.mjs src/agents/sessions/extensions/loader.test.ts -- --reporter=dot;./node_modules/.bin/oxfmt --check --threads=1 src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/resource-loader.ts;OPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/resource-loader.ts;git diff --check origin/main...HEAD;.agents/skills/autoreview/scripts/autoreview --mode local; AWS Crabbox fresh PROPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed.run_009f40ac4028on leasecbx_816e7d563d3a(c7a.8xlarge) passedpnpm check:changedwith lanescore, coreTests, exit 0.healthy_lookupremains registered, the extension command registered after the bad tools remains present, and the healthy tool method keeps its original receiver.core, coreTestslanes in a fresh PR checkout.registerToolreadtool.namedirectly and stored the raw definition, so a throwingnameor later schema getter could fail extension loading or crash later registry reads.Tests and validation
Focused commands run:
node scripts/run-vitest.mjs src/agents/sessions/extensions/loader.test.ts -- --reporter=dot./node_modules/.bin/oxfmt --check --threads=1 src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/resource-loader.tsOPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/resource-loader.tsgit diff --check origin/main...HEAD.agents/skills/autoreview/scripts/autoreview --mode localRegression coverage added:
Risk checklist
YesNoYesCurrent review state
Next action: maintainer review.
Waiting on: CI/maintainer review.
Reviewer comments addressed: local
$autoreviewreported no accepted/actionable findings.