fix(providers): skip unreadable Anthropic payload tool schemas#90289
fix(providers): skip unreadable Anthropic payload tool schemas#90289vincentkoc wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 4, 2026, 6:32 AM ET / 10:32 UTC. Summary PR surface: Source +35, Tests +100. Total +135 across 2 files. Reproducibility: yes. Source inspection shows current main directly reads schema fields during wrapper normalization, so a tool object with a throwing getter on Review metrics: none identified. 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: Keep the fix in the existing Anthropic-family payload compatibility wrapper with the focused regression tests, then merge only after the draft PR has normal maintainer and CI validation. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main directly reads schema fields during wrapper normalization, so a tool object with a throwing getter on Is this the best way to solve the issue? Yes. The PR fixes the narrow owner path that performs the Anthropic-to-OpenAI tool payload conversion, preserves healthy tools, and avoids a new config/API surface. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 88eb40549188. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +35, Tests +100. Total +135 across 2 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
|
|
Landed the same issue with broader contract coverage in #92908 ( The landed fix keeps healthy siblings, quarantines nested/non-serializable/structurally invalid schemas, reconciles function/custom/string/ I could not update this branch because maintainer edits are disabled, so I recreated the fix on a maintainer branch and preserved your authorship with Thanks, @vincentkoc. Enabling Allow edits by maintainers on future PRs lets us apply fixups directly instead of recreating the branch. |
Summary
parametersgetters andinput_schemaprecedenceVerification
node scripts/run-vitest.mjs run src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.test.tsnode scripts/run-oxlint.mjs src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.ts src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.test.ts./node_modules/.bin/oxfmt --check --threads=1 src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.ts src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.test.tsgit diff --check origin/main...HEAD.agents/skills/autoreview/scripts/autoreview --mode local.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainReal behavior proof
Behavior addressed: Anthropic-family OpenAI-compatible payload wrapping could throw while normalizing a malformed plugin/provider tool whose schema field was exposed through a throwing getter.
Real environment tested: local linked OpenClaw worktree on
fuzz-tool-schema-next199-20260604, rebased ontoorigin/mainat045145c7008, Node wrapper test harness.Exact steps or command run after this patch:
node scripts/run-vitest.mjs run src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.test.ts.Evidence after fix: focused Vitest passed 1 file / 2 tests; oxlint, oxfmt, diff check, local autoreview, and branch autoreview all passed.
Observed result after fix: the wrapper no longer throws on a poisoned
parametersgetter, drops the unreadable tool, preserves healthy tools, and uses validinput_schemawithout reading the poisoned fallback.What was not tested: broad
pnpm check:changeddid not run because Blacksmith Testbox was unauthenticated and Crabbox sparse-sync preflight failed before remote execution with less than 1 GiB free in the local Crabbox sparse-sync cache.