Repository navigation
fix(mistral): report unreadable tools before requests - #173312
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 maintainer review before merge. What this changesThis PR reports unreadable Mistral tool definitions as stream errors instead of silently omitting them. Example: A request includes healthy_tool and broken_tool, whose parameters getter throws.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it implements an explicitly accepted maintainer direction, and no definite introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Mistral adapter converts conversation messages and tool definitions into SDK requests and returns assistant stream events or terminal errors. flowchart LR
A[Conversation and tools] --> B[Mistral payload builder]
B --> C[Tool conversion]
C --> D[Mistral SDK request]
C --> E[Stream error owner]
D --> F[Assistant events]
E --> F
Technical reviewBest possible solution: Use the existing stream error owner to expose conversion failures while preserving valid-tool cloning and ordering. Do we have a high-confidence way to reproduce the issue? Current-main source shows that a throwing tool getter or clone failure is swallowed per tool; the changed tests exercise those errors through streamMistral, but no code was executed during this review. Is this the best way to solve the issue? Removing the catch is a focused implementation of the accepted direction and reuses the existing terminal-error path without changing successful request construction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e0728f7f72f7. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -4, Tests -4, Docs +3. Total -5 across 3 files. Added test files: 0. 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 15, 2026, 1:17 PM ET / 17:17 UTC. |
## What Problem This Solves Fixes silent omission of Mistral tools when a plugin supplies an unreadable tool definition or a schema that cannot be cloned. ## User Impact The request now fails before contacting Mistral and reports the original definition error. Valid tools, schema detachment, tool ordering, and streamed results are unchanged. No migration or configuration change is required. ## Why This Change Was Made The per-tool catch returned an empty list, allowing the adapter to continue with a reduced or empty tool set. Let the existing stream error owner report conversion failures instead. This is a real silent-failure fix, published under the campaign's any-size bug-fix exception: **4 net production lines removed** (tests and README excluded). ## Best-effort tradeoffs accepted - Removed per-tool catch-and-drop: an unreadable getter or non-cloneable schema no longer quarantines only that tool while sending the rest. openclaw#90242 introduced quarantine with a synthetic unreadable-getter fixture and live Mistral probe, without a linked human actual-use incident; openclaw#172587 retained it. The stream now reports the original error before any request; the caller can repair the tool definition and retry. ## Evidence - Provider-boundary suite: 30/30 passing, including unreadable definitions alone and alongside a valid tool, with zero requests sent; existing valid-tool and schema-detachment coverage retained. - Core production typecheck and focused type-aware Mistral lint passed. - Fresh independent Codex review: scoped-clean through P2, with byte-identical production/test files at commit time. - Runtime import cycles: 0; Madge cycles: 0. Standalone lint-suppressions gate: 3/3 passing. No import edges changed in this bug fix. - [Hosted CI on the exact head](https://github.com/openclaw/openclaw/actions/runs/38773777501) passed. No CI rerun or green-only push. - No live-provider claim: this changes local definition failure handling, not the Mistral wire contract. - Local check-changed was attempted: conflict markers, line-cap and assertion-safety checks passed; max-lines reported stale baseline entries in two untouched test files. The SQLite ratchet made no progress for over 12 minutes and was stopped, without altering baselines. Hosted CI on this exact head is the broad gate.
What Problem This Solves
Fixes silent omission of Mistral tools when a plugin supplies an unreadable tool definition or a schema that cannot be cloned.
User Impact
The request now fails before contacting Mistral and reports the original definition error. Valid tools, schema detachment, tool ordering, and streamed results are unchanged. No migration or configuration change is required.
Why This Change Was Made
The per-tool catch returned an empty list, allowing the adapter to continue with a reduced or empty tool set. Let the existing stream error owner report conversion failures instead. This is a real silent-failure fix, published under the campaign's any-size bug-fix exception: 4 net production lines removed (tests and README excluded).
Best-effort tradeoffs accepted
Evidence