fix(agents): snapshot session tool definitions#91293
Conversation
|
Codex review: needs changes before merge. Reviewed June 25, 2026, 10:37 PM ET / 02:37 UTC. Summary PR surface: Source +410, Tests +294. Total +704 across 9 files. Reproducibility: yes. Source inspection gives a high-confidence path: construct an AgentTool or ToolDefinition with throwing name/parameters getters and call toToolDefinitions(), createAgentSession(), or extension registerTool(); I did not execute that repro 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: Refresh the branch against current main, keep the snapshot-boundary design, preserve current metadata contracts, replace unsafe error formatting with no-throw formatting, and have maintainers explicitly accept the per-tool quarantine compatibility change. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence path: construct an AgentTool or ToolDefinition with throwing name/parameters getters and call toToolDefinitions(), createAgentSession(), or extension registerTool(); I did not execute that repro in this read-only review. Is this the best way to solve the issue? No as written. Snapshotting at the session/tool boundary is the right fix shape, but this implementation needs metadata preservation, no-throw error formatting, and an explicit maintainer compatibility decision first. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6830aa39eaa1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +410, Tests +294. Total +704 across 9 files. View PR surface stats
Security concerns:
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
|
|
Closing this one. This is a 737-line carryover from a superseded fuzz stack, with no user report and only synthetic getter/mutation cases across typed session and extension tool definitions. Deep schema cloning, accessor evaluation, rebinding, and quarantine across nine files is disproportionate and changes the SDK/session contract. A real untyped ingress bug should be fixed narrowly at that boundary. Thanks for consolidating the earlier experiments. |
Summary
b4cc7c792c9and8c92f6bc055.Verification
node scripts/run-vitest.mjs run src/agents/agent-tool-definition-adapter.test.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/sdk.test.ts src/agents/sessions/tools/tool-definition-wrapper.test.ts --reporter=dot./node_modules/.bin/oxfmt --check src/agents/agent-tool-definition-adapter.test.ts src/agents/agent-tool-definition-adapter.ts src/agents/sessions/agent-session.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/extensions/loader.ts src/agents/sessions/sdk.test.ts src/agents/sessions/sdk.ts src/agents/sessions/tools/tool-definition-wrapper.test.ts src/agents/sessions/tools/tool-definition-wrapper.tsOPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/agent-tool-definition-adapter.test.ts src/agents/agent-tool-definition-adapter.ts src/agents/sessions/agent-session.ts src/agents/sessions/extensions/loader.test.ts src/agents/sessions/extensions/loader.ts src/agents/sessions/sdk.test.ts src/agents/sessions/sdk.ts src/agents/sessions/tools/tool-definition-wrapper.test.ts src/agents/sessions/tools/tool-definition-wrapper.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainBehavior addressed
Real environment tested
Exact steps or command run after this patch
Evidence after fix
Observed result after fix
What was not tested
pnpm check:changedwas not run locally because this is a linked/sparse worktree and disk is currently tight; PR CI should cover the wider gate.