fix(agents): project nullable tool schemas for providers#88880
fix(agents): project nullable tool schemas for providers#88880vincentkoc wants to merge 6 commits into
Conversation
|
Codex review: found issues before merge. Reviewed June 20, 2026, 4:15 AM ET / 08:15 UTC. Summary PR surface: Source +93, Tests -126. Total -33 across 12 files. Reproducibility: yes. at source level: current main has nullable cron clear schemas and the active projectRuntimeToolInputSchema helper returns serialized schemas unchanged, while related provider-normalizer evidence shows strict Gemini-compatible providers reject those shapes. I did not run a live provider turn in this read-only review. 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: Rebase first, then either port the accepted normalization into the active current-main schema boundary with explicit maintainer approval for the broad contract change, or defer the concrete Gemini regression to #91559. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main has nullable cron clear schemas and the active projectRuntimeToolInputSchema helper returns serialized schemas unchanged, while related provider-normalizer evidence shows strict Gemini-compatible providers reject those shapes. I did not run a live provider turn in this read-only review. Is this the best way to solve the issue? No, not as submitted: the branch targets a stale helper and applies cleanup through a broad runtime/Codex-facing projection path. The safer path is a rebase plus maintainer choice between broad shared projection and narrower provider/model-specific normalization. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a1271830948b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +93, Tests -126. Total -33 across 12 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
|
15c66cf to
c54a143
Compare
c54a143 to
ef6bc22
Compare
4caf7f9 to
8aeaadf
Compare
|
Closing as superseded by narrower fixes now on This branch combined two real concerns: runtime validation must preserve explicit null clears, and Gemini-backed provider payloads need a compatible projected schema. Runtime null-union coercion was fixed narrowly in #97212. Provider normalization now belongs to Thanks for the investigation and tests, @vincentkoc. |
Summary
nullclear sentinels during raw argument validation before provider projectionstringVerification
Reviewed/proved local head:
8aeaadf963aReviewed/proved base:
db4990d2605Current note:
origin/mainadvanced again after the final review; GitHub CI/mergeability should arbitrate the pushed branch against the newest base.node scripts/run-vitest.mjs packages/llm-core/src/validation.test.ts src/agents/tool-schema-projection.test.ts src/agents/tools/cron-tool.schema.test.ts src/agents/tools/cron-tool.test.ts --reporter=dot- passed 3 shards / 118 testsnode --import tsx scripts/generate-prompt-snapshots.ts --check- passed,Prompt snapshots are current (7 files).node_modules/.bin/oxfmt --check --threads=1 packages/llm-core/src/validation.test.ts packages/llm-core/src/validation.ts src/agents/tool-schema-projection.test.ts src/agents/tool-schema-projection.ts src/agents/tools/cron-tool.schema.test.ts src/agents/tools/cron-tool.test.ts- passednode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json packages/llm-core/src/validation.test.ts packages/llm-core/src/validation.ts src/agents/tool-schema-projection.test.ts src/agents/tool-schema-projection.ts src/agents/tools/cron-tool.schema.test.ts src/agents/tools/cron-tool.test.ts- passedgit diff --check origin/main...HEAD- passed on the reviewed base.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --prompt 'Review the pruned provider/runtime tool schema projection hardening branch after rebasing onto latest main. Focus only on actionable regressions in provider-facing schema projection, raw validation preservation, non-null union preservation, and prompt snapshot correctness. Do not inspect external repositories unless essential.'- clean, no accepted/actionable findings,overall: patch is correct (0.76)Real behavior proof
Behavior addressed: Provider-facing runtime tool schema projection no longer leaks nullable OpenAPI-incompatible shapes for covered runtime schemas, while raw validation still accepts explicit null clear sentinels and mixed non-null unions remain represented as unions.
Real environment tested: Local OpenClaw Codex/gwt worktree on macOS with shared repo
node_modules, using the repo Vitest wrapper plus snapshot, format, lint, diff, scrub, and autoreview gates.Exact steps or command run after this patch: The focused Vitest, prompt snapshot, oxfmt, oxlint, diff-check, private-name scrub, and autoreview commands listed above were run after the final rebase.
Evidence after fix: Focused tests passed 3 shards / 118 tests; prompt snapshots were current; oxfmt, oxlint, and diff-check passed; autoreview reported no accepted/actionable findings.
Observed result after fix: Nullable provider schema branches are projected to provider-compatible schemas, unsupported dynamic keywords are still reported from raw schemas, explicit null clear values validate correctly, and mixed non-null unions are preserved instead of narrowed.
What was not tested: A live provider turn or full
pnpm check:changedwas not run for this narrow PR; GitHub CI is expected to cover the pushed branch against the latest movingmain.