Repository navigation
refactor(ai): share Mistral text delta appends - #157664
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: needs maintainer review before merge. Reviewed September 24, 2026, 9:02 PM ET / September 25, 2026, 01:02 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Mistral stream adapter routes string and typed text deltas through one private append path and expands provider and HTTP/SSE tests for event behavior. Merge readiness✅ Ready for maintainer review Keep open: current main has not absorbed this cleanup, and the introduced patch has no identified correctness blocker. The previous review also recorded no findings. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's Mistral adapter receives model response chunks through the Mistral SDK. It turns text, thinking, and tool content into assistant events and a final result. flowchart LR
A[Agent model request] --> B[Mistral SDK stream]
B --> C[Mistral adapter]
C --> D{Content form}
D -->|String or text item| E[Shared text append]
D -->|Thinking or tool item| F[Other event handling]
E --> G[Assistant events and result]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -9, Tests +101. Total +92 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one Mistral-owned text append path and retain boundary checks for observable event identity and ordering. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal refactor rather than a reported bug. Current main visibly retains the duplicated blocks. Is this the best way to solve the issue? Yes: consolidating the two branches inside the existing Mistral adapter is a narrow way to remove duplication while preserving its event contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 281967681fd0. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ...
|
Merged via squash.
|
* refactor(ai): share Mistral text delta appends * Merge main to incorporate the upstream update type fix * commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits) fix(subagents): stop completion transcript retry loops (openclaw#157571) perf(sessions): remove duplicate foreground history reference scans (openclaw#157572) improve(typesafe): defer startup work until the first decision (openclaw#157380) fix(update): restore npm-pack helper typechecking (openclaw#157659) fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471) refactor(infra): share process error handler registries (openclaw#157632) chore(ui): refresh control ui locales (openclaw#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592) perf(plugins): reuse declared tool membership during resolution (openclaw#156205) fix(ui): pasted text previews fail before sending (openclaw#157390) fix(agents): wait for database resources during deletion (openclaw#157631) improve: move operator profile database reads off the Gateway thread (openclaw#155800) fix: explain rejected settings without losing edits (openclaw#157549) fix: keep Gateway responsive while recording trajectory events (openclaw#157598) fix(auth): show SIWC email and selected model account identity (openclaw#157629) docs: explain Codex app approval precedence (openclaw#155089) refactor(wizard): share select prompt requests (openclaw#157607) fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590) fix(doctor): explain update lint supervisor refusals (openclaw#156547) fix(ui): GitHub folder links lose repository context (openclaw#157619) ... Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Mistral streaming duplicates text-delta accumulation and event construction for string content and typed text items.
User Impact
No transport or API behavior change. The existing dispatch branches and control flow remain; empty deltas, Unicode normalization, content indices, event order, shared partial-output identity, and thinking/tool transitions retain their behavior.
Why This Change Was Made
This specific private text-delta consolidation is a requested active deliverable in the maintainer cleanup campaign. One synchronous private
appendTextDeltahelper replaces the two duplicate blocks. Production -9 lines, tests +101 lines. No exported API, configuration, persisted state or migration change.Evidence
0484d7a3ecf52589b0d3d98741e58e5f6b5bf661, including the separately owned import repair in fix(update): restore npm-pack helper typechecking #157659. The three-path proposal patch remains byte-identical to the reviewed incoming change. Earlier hosted TS2459 failures remain failed historical evidence.