Repository navigation
fix: long streamed replies that quote tool-call transcripts no longer stall the Gateway - #186605
JasonBuildAI wants to merge 17 commits into
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. |
ab37afd to
4f89bd2
Compare
4f89bd2 to
7ca09e5
Compare
…delta A final answer that quotes a legacy [TOOL_CALL] block or a downgraded [Tool Call: ...] transcript inside code kept re-running the canonical sanitizer, including its full Markdown ownership parse, on every delta. Both stages now project incrementally: they scan when a marker bracket arrives or a candidate is open, reuse code ranges across appends, and append the rest of the tail verbatim. Fixes openclaw#186601
7ca09e5 to
3a26eb4
Compare
|
Codex review: needs real behavior proof before merge. What this changesThis PR incrementally filters legacy and downgraded tool transcripts while preserving quoted code and streaming corrections. Example: An 8 KiB answer quotes a fenced [TOOL_CALL] transcript and arrives in four-character deltas.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain This PR addresses a current-main Gateway stall and fixes the previous split-header finding; the explicitly paused UI bundle-budget decision remains unresolved. Priority: P1 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherAssistant text deltas enter shared sanitizer projections, which remove internal scaffolding and emit visible text with append or replacement updates for Gateway and channel delivery. flowchart LR
A[Assistant text deltas] --> B[Visible text projection]
B --> C[Ordered transcript filters]
C --> D[Canonical Markdown checkpoints]
D --> E[Visible text and correction deltas]
E --> F[Gateway and channel delivery]
Technical reviewBest possible solution: Retain the canonical checkpoint repair and reduce its UI bundle cost unless the performance owner explicitly accepts the measured increase. Do we have a high-confidence way to reproduce the issue? Current-main source confirms accumulated-input sanitization after marker activation, and the linked report supplies concrete four-character-delta workloads and parser measurements; this read-only review executed no target code. Is this the best way to solve the issue? Reusing the existing Markdown checkpoint owner is a focused root-cause repair, preserves ordered removal semantics, and removes the superseded resolver without introducing a competing parser. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 69d6eae050eb. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +142, Tests -1. Total +141 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (3 earlier review cycles)
Reviewed November 5, 2026, 12:35 AM ET / 05:35 UTC (Revision 4). |
…delta A final answer that quotes a legacy [TOOL_CALL] block or a downgraded [Tool Call: ...] transcript inside code kept re-running the canonical sanitizer, including its full Markdown ownership parse, on every delta. Both stages now project incrementally: they scan when a marker bracket arrives or a candidate is open, reuse code ranges across appends, and append the rest of the tail verbatim. Fixes openclaw#186601
3a26eb4 to
60f3220
Compare
…delta A final answer that quotes a legacy [TOOL_CALL] block or a downgraded [Tool Call: ...] transcript inside code kept re-running the canonical sanitizer, including its full Markdown ownership parse, on every delta. Both stages now project incrementally: they scan when a marker bracket arrives or a candidate is open, reuse code ranges across appends, and append the rest of the tail verbatim. Fixes openclaw#186601
60f3220 to
57624c4
Compare
Do not reject an unfinished legacy header before its pending state is recorded. The canonical wrapper retains the quick guard, while streaming checkpoints can keep a whitespace-split opening bracket until the header completes. This also removes duplicate validation from the shared scanner. Strengthen the existing legacy cases with prefix and reconstruction checks, including a header split across blank lines, without adding test lines. Co-authored-by: JasonBuildAI <[email protected]>
Use the existing Markdown code regions when deciding whether an unfinished legacy header must retain the checkpoint. Literal examples remain eligible for incremental settlement. Extend the existing work fixture without adding test lines. Co-authored-by: JasonBuildAI <[email protected]>
Keep unfinished bracket candidates pending only outside canonical code regions in each downgraded removal pass. Quoted Tool Call, Tool Result, and historical headers must not retain the entire reply after their fence closes. Extend the existing work fixture for these cases without adding test lines. Co-authored-by: JasonBuildAI <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…6667) Long streamed replies containing quoted tool-call transcripts or repeated inline-code paragraphs repeatedly parsed accumulated Markdown and stalled Gateway streaming. Reuse canonical Markdown checkpoints and one shared duplicate-paragraph owner while preserving exact inline-code bytes and correction deltas. Includes the complete transcript-streaming repair from #186605. Thanks @JasonBuildAI for the original reports and investigation. Closes #186598 Closes #186601 Validation: exact-head CI passed at https://github.com/openclaw/openclaw/actions/runs/41980269737, including Control UI performance with unchanged budgets. Lead-verified focused tests and isolated built-Gateway synthetic/live-model runs preserved complete previews and final output. Local runtime proof was on macOS; complex Markdown retains its documented conservative fallback. Full evidence remains in the PR body. Co-authored-by: JasonBuildAI <[email protected]>
|
Thanks @JasonBuildAI. This work landed through #186667 (c6a601f) with your co-author credit. Its head contained every commit of this branch, so both streaming fixes could land together, and that combined head is the one that passed the Control UI size budget. Closing this one as superseded, with nothing lost. |
…nclaw#186667) Long streamed replies containing quoted tool-call transcripts or repeated inline-code paragraphs repeatedly parsed accumulated Markdown and stalled Gateway streaming. Reuse canonical Markdown checkpoints and one shared duplicate-paragraph owner while preserving exact inline-code bytes and correction deltas. Includes the complete transcript-streaming repair from openclaw#186605. Thanks @JasonBuildAI for the original reports and investigation. Closes openclaw#186598 Closes openclaw#186601 Validation: exact-head CI passed at https://github.com/openclaw/openclaw/actions/runs/41980269737, including Control UI performance with unchanged budgets. Lead-verified focused tests and isolated built-Gateway synthetic/live-model runs preserved complete previews and final output. Local runtime proof was on macOS; complex Markdown retains its documented conservative fallback. Full evidence remains in the PR body. Co-authored-by: JasonBuildAI <[email protected]>
Fixes #186601
Not ready to land: a Control UI bundle-budget decision is required. The streaming checks pass, but this revision exceeds the differential UI budgets below. No budget baseline has been changed.
What Problem This Solves
Long streamed answers quoting legacy
[TOOL_CALL], downgraded[Tool Call: ...], or historical transcript markers repeatedly parse the whole reply and can stall the Gateway.User Impact
Quoted examples stay visible and stream promptly. Unquoted scaffolding is removed, including after a fenced block leaves a list or blockquote. No configuration or migration is needed.
Why This Change Was Made
Each canonical removal pass uses the existing container-aware Markdown checkpoint owner because removing one marker can expose a fence for the next pass. Incomplete candidates remain pending; settled text stops participating in subsequent scans. The separate resolver was removed, preserving existing trim and correction semantics.
The refresh also fixes a previously missed checkpoint case: an unquoted legacy header split across blank lines must stay pending before its closing bracket arrives. Quoted incomplete headers use canonical code protection and continue settling incrementally. The same protected-region rule is applied independently in each downgraded removal pass. The existing regression suites cover all marker families without adding test lines.
Thanks @JasonBuildAI for the report, original implementation, and reproduction workloads. All contributor commits and credit are preserved through merges; no rebase or force-push.
Evidence
Current head:
67618a3d03406cb5e0da894cd3d008c433765777. Main merge base:bca996c12f5568a125d2159fc87186213f1a705c.createAssistantVisibleStreamText("final_answer"), four-character deltas, still parses 16,785,006 legacy / 33,568,848 downgraded characters at 8 KiB. Both committed work regressions fail on main for their scan budget, with correct output.Prior isolated built-Gateway evidence is retained: nine synthetic WebSocket responses had exact streaming/final text, and a real shared Ollama
qwen2.5:7bturn completed in 3.24 s with 566 canonical final characters. That is historical proof, not a new live run of this corrective head. Further live qualification stops at the new budget decision; the checkpoint correction is covered at its owning projection boundary.Production +206/-64 (net +142); tests +71/-72 (net -1). Remaining source growth carries checkpoint/candidate state and canonical pass composition. There is one Markdown ownership implementation. Validation is local macOS. #186667 remains the second step and must follow this PR.
Final remote verification
Exact-head CI 41974491724 completed with only
control-ui-performancefailing, which madeopenclaw/ci-gatefail. The failure table classifies it as new; its comparison found +290 B new-session and +518 B chat gzip growth. ClawSweeper reviewed this exact head with no code findings; its remaining requests are the declared fresh-Gateway proof and bundle-budget decision.