Repository navigation
refactor(ai): simplify bounded tool preparation and report broken descriptors - #177997
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR simplifies bounded schema traversal and makes OpenAI and Anthropic report broken tool descriptors before sending requests. Example: A tool named broken throws "parameters exploded" while a healthy lookup tool is also available.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep open: the maintainer-approved simplification is useful, but two unmigrated consumer suites cause definite CI failures. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe AI package converts runtime tool descriptors into provider request payloads; schema cleaners bound and normalize parameters, while existing stream lifecycles report preparation errors. flowchart TD
A[Runtime tool descriptors] --> B[Provider projection]
B --> C[Bounded schema preparation]
C --> D[Provider request payload]
D --> E[Provider transport]
B --> F[Stream error owner]
C --> F
Technical reviewBest possible solution: Keep the existing preparation and stream owners, and migrate the remaining consumer fixtures while preserving their valid-wire, quarantine, and history-marker contracts. Do we have a high-confidence way to reproduce the issue? Source shows the old silent omission and the new error path; exact-head CI independently demonstrates the missed consumer expectations, without reviewer execution of target code. Is this the best way to solve the issue? The simpler implementation uses existing depth and stream-error owners appropriately, but its cutover is incomplete until the two remaining consumer suites reflect the accepted contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 29a7aa0a4025. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -139, Tests +10, Docs 0. Total -129 across 15 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 19, 2026, 11:52 PM ET / October 20, 2026, 03:52 UTC. |
|
Merged via squash.
|
…criptors (openclaw#177997) * refactor(ai): rely on bounded schema traversal and date grammar * refactor(ai): let stream owners report descriptor failures * test(ai): build descriptor cases with explicit fields * refactor(ai): retain OpenAI descriptor quarantine pending fixture migration
Honor a8bc87f (#177997): unreadable descriptors fail the stream before request handoff, even with a forced healthy sibling. Keep the live healthy-tool proof focused on readable malformed schemas, and verify forced healthy projection separately offline. No transport behavior or quarantine is restored. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit bfb1fdea6b120a3974369092d615f9fdc7e7131e)
What Problem This Solves
Simplifies bounded tool preparation and reports broken Anthropic tool descriptors before sending a provider request instead of silently omitting them.
User Impact
Anthropic now returns the original descriptor-access error through its existing stream error path, matching Mistral. Valid tools, prompt ordering, schema validation/detachment, required/pinned tool choices, and public signatures remain unchanged. OpenAI descriptor behavior is unchanged. No migration or configuration change is required.
Why This Change Was Made
The shared 128-level schema boundary makes the private generator trampoline and second cycle tracker redundant. HTTP-date grammar and the retained UTC roundtrip already enforce the removed component checks. Provider request lifecycles already own preparation errors, so descriptor-specific catch-and-drop plumbing adds a silent failure path. Mistral's empty-conversion recovery is unreachable after #173312 stopped filtering conversion failures.
This completes an AI-area residue under the campaign's floor waiver: 107 net production lines removed (+62/-169), excluding tests/docs. It is not counted as a LARGE PR.
Best-effort tradeoffs accepted
normalizeGeminiToolSchemasrecurses with no depth limit → RangeError #152866; later fix(tools): keep deeply nested tool schemas callable #164836 installed the shared bounded/cycle-checking ingress owner. That protection stays, including Gemini reference-expansion depth/cycle handling. Ordinary recursion now operates only within its bound.Evidence
git diff --checkpassed. No new suppressions or production import edges; broad graph/platform gates belong to exact-head PR CI under the local CPU limit.toFunctionToolsmaps and sorts without filtering: successful nonempty input cannot produce an empty set. The finding assumed the pre-fix(mistral): report unreadable tools before requests #173312 quarantine implementation. Named-tool availability checks remain. The earlier production review was scoped-clean; no accepted/actionable finding remains.31af7d48303d3bdc4bd64cd5b7c4dde2d183687b: hosted run39366961998 completed SUCCESS, including all eight UI E2E shards, types, lint, architecture and effective CI/security gates. No CI rerun was requested.CI repair and parked slice
Initial head
1563cd7bd5eca3b4e6628e40cf4335964a20ec0bhad three failing leaf jobs in run39365054613. The OpenAI descriptor cut left obsolete getter fixtures in ancillary tests and made a max-lines suppression unnecessary. Their fixture file is touched by recent open #168513 and #130067. To honor the lane's file-collision rule, the entire OpenAI descriptor/test/consumer slice was removed from this PR and preserved on pushed branchdeslop/z43-parked-openai-descriptors-20261015without another PR. It needs the two fixture migrations after those collisions resolve. No production hunk unrelated to that slice was dropped.The other failure is
custodian-onboarding-locale.e2e.test.tstiming out at the mocked-Gateway browser heading wait, identical to independent queue PR #177986. This is tracked separately as an inherited UI failure; no matching-main reproduction or green CI is claimed. Exact-head CI for the repaired branch remains the broad gate.