fix(agents): contain provider schema hook failures#89669
Conversation
|
Codex review: found issues before merge. Reviewed July 3, 2026, 9:48 AM ET / 13:48 UTC. Summary PR surface: Source +138, Tests +95. Total +233 across 5 files. Reproducibility: yes. by source inspection. Current main directly invokes provider normalize and inspect hooks from runtime projection helpers, so a throwing provider/plugin hook propagates before this PR; no live third-party provider plugin repro was run. Review metrics: 2 noteworthy metrics.
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: Land one refreshed canonical hook-containment branch that keeps provider hook helpers strict by default, opts assistant projection into warn mode explicitly, uses total redacted error formatting, and preserves doctor/check strictness with current-main proof. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection. Current main directly invokes provider normalize and inspect hooks from runtime projection helpers, so a throwing provider/plugin hook propagates before this PR; no live third-party provider plugin repro was run. Is this the best way to solve the issue? No as-is. The shared runtime helper is a plausible layer, but the best fix should preserve strict defaults, make assistant warn mode explicit, and use a total redacted error formatter before warning logs are emitted. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c915f068525. Label changesLabel justifications:
Evidence reviewedPR surface: Source +138, Tests +95. Total +233 across 5 files. View PR surface stats
Security concerns:
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 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
Verification
CI=1 node scripts/run-vitest.mjs run src/agents/embedded-agent-runner/tool-schema-runtime.test.ts src/agents/runtime-plan/tools.test.ts src/flows/doctor-core-checks.runtime-errors.test.ts src/commands/doctor/shared/active-tool-schema-warnings.test.ts --reporter=verbose./node_modules/.bin/oxfmt --write src/agents/embedded-agent-runner/tool-schema-runtime.ts src/agents/embedded-agent-runner/tool-schema-runtime.test.ts src/agents/runtime-plan/tools.ts src/flows/doctor-core-checks.runtime.ts src/commands/doctor/shared/active-tool-schema-warnings.ts./node_modules/.bin/oxlint src/agents/embedded-agent-runner/tool-schema-runtime.ts src/agents/embedded-agent-runner/tool-schema-runtime.test.ts src/agents/runtime-plan/tools.ts src/flows/doctor-core-checks.runtime.ts src/commands/doctor/shared/active-tool-schema-warnings.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainrun_23545b82a3f6, leasecbx_29277eee67f0, typec7a.8xlarge:env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changedpassed with exit 0; lanescore,coreTests; lease stopped.Real behavior proof
Behavior addressed: Provider-owned tool-schema normalization/diagnostic hooks can no longer crash assistant runtime projection before content, while doctor still reports normalization failures as health findings.
Real environment tested: Local Codex worktree on branch
fuzz-tool-schema-next64-20260603at commit3662c8cea8284ccbe35c05864419a655959a00d6; remote AWS Crabbox changed gaterun_23545b82a3f6/cbx_29277eee67f0.Exact steps or command run after this patch: Focused Vitest command above covered runtime hook fallback, runtime-plan flag forwarding, doctor runtime errors, and active doctor warnings; AWS Crabbox ran
pnpm check:changedremotely.Evidence after fix: 4 focused test files passed; oxfmt, oxlint, git diff check, autoreview, and AWS Crabbox
check:changedpassed.Observed result after fix: Runtime normalization falls back to the already-filtered tools and logs a warning; doctor call sites opt into rethrowing and keep surfacing provider/plugin schema normalization failures.
What was not tested: Live provider/tool execution against a real third-party provider plugin was not run; this lane covers the runtime boundary with focused unit tests and remote changed gates.