fix(agents): ignore unreadable session tool metadata#89513
Conversation
|
Codex review: needs changes before merge. Reviewed June 29, 2026, 8:56 PM ET / 00:56 UTC. Summary PR surface: Source +118, Tests +130. Total +248 across 9 files. Reproducibility: yes. Source inspection shows current main and v2026.6.10 directly read tool.name, definition.name, and schema metadata during extension registration and session registry refresh; I did not execute tests in this read-only review. 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:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Keep the metadata hardening, remove accidental public SDK helper exports, and land one maintainer-approved malformed-tool policy across the overlapping branches. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.10 directly read tool.name, definition.name, and schema metadata during extension registration and session registry refresh; I did not execute tests in this read-only review. Is this the best way to solve the issue? No, not as submitted. The session hardening boundary is plausible, but the helper exports should stay internal and maintainers still need to choose the intended malformed-tool contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 587eefe5ad91. Label changesLabel justifications:
Evidence reviewedPR surface: Source +118, Tests +130. Total +248 across 9 files. View PR surface stats
Acceptance criteria:
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
|
8ad0c58 to
be3e85a
Compare
be3e85a to
c62833d
Compare
c62833d to
b74a7ed
Compare
|
Closing this one. The nine-file change is based on custom/extension tool objects with poisoned typed fields and no installed extension or real startup failure. Session startup should not accumulate catch-and-skip metadata rules across loader, wrapper, runner, SDK, and registry. If an untyped extension boundary is observed to admit bad data, validate it once there with an explicit diagnostic. Thanks for mapping the full path. |
Summary
name/ schema metadata skips the malformed tool instead of crashing session startup or refresh.Verification
node scripts/run-vitest.mjs src/agents/sessions/sdk.test.ts src/agents/sessions/extensions/loader.test.ts -- --reporter=dot./node_modules/.bin/oxfmt --check src/agents/sessions/tools/tool-definition-wrapper.ts src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/extensions/runner.ts src/agents/sessions/extensions/wrapper.ts src/agents/sessions/sdk.ts src/agents/sessions/agent-session.ts src/agents/sessions/sdk.test.ts src/agents/sessions/tools/index.ts./node_modules/.bin/oxlint src/agents/sessions/tools/tool-definition-wrapper.ts src/agents/sessions/extensions/loader.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/extensions/runner.ts src/agents/sessions/extensions/wrapper.ts src/agents/sessions/sdk.ts src/agents/sessions/agent-session.ts src/agents/sessions/sdk.test.ts src/agents/sessions/tools/index.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode localpnpm check:changed: provideraws, leasecbx_bebed30ed07e, runrun_b3a68dec96fd, exit 0Real behavior proof
Behavior addressed: Session startup and tool-registry refresh skip malformed SDK custom tools or extension tools with unreadable registry metadata instead of throwing before a valid tool registry can be built.
Real environment tested: Local macOS sparse
gwtworktree with shared repo dependencies; AWS Crabbox Linuxc7a.8xlargefresh PR checkout at headb74a7ed8d7c.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/sessions/sdk.test.ts src/agents/sessions/extensions/loader.test.ts -- --reporter=dot;env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changedon AWS Crabbox.Evidence after fix:
sdk.test.tscovers SDK custom tools and already-registered extension tools with throwingname/parametersgetters;loader.test.tscovers productionapi.registerToolregistration with a throwingnamegetter; remotecheck:changedselectedcore, coreTestsand completed successfully.Observed result after fix: Focused Vitest shards passed, formatter/lint/diff checks passed, autoreview reported no accepted/actionable findings, and AWS Crabbox
check:changedexited 0.What was not tested: No live extension package was installed; coverage uses session/loader regression tests around the registration and registry paths.