fix(llmapp): order streamed text via sealed control segments#91
Merged
Conversation
added 2 commits
June 3, 2026 17:01
Route authoritative assistant text through the ctrl FIFO alongside tool events. Keep TokenStream as preview-only and make View read-only over previewNodes. Spec: spec-1.21.1-stream-ordering-fix.md
Owner
Author
spec-1.21.1 implementation update — CI greenImplemented the R2.1 sealed-control architecture and fixed the transient CI security drift. Implementation status
Verification
Codex local review noteNo new blocking finding from the implementation diff. Permanent transcript ordering is controlled by ctrl FIFO. Preview remains best-effort/transient by design and is cleared when sealed text commits, so producer run-ahead cannot pollute scrollback. |
三路 post-impl review absorb(code-reviewer APPROVE + go-reviewer APPROVE-WITH-FIXES + codex REQUEST-CHANGES 2H)。codex H-1(regression, 按用户 verdict 标准 = HIGH):cancel-mid-segment 丢 partial assistant 文本 + [已取消] marker —— Loop emit-error break 不发 EventFinish,partial 在 previewNodes(PreviewTick 缓存),streamDoneMsg 原 drain-discard 丢弃。修: streamDoneMsg final-flush 从 previewNodes(+ Close 残留)恢复 partial 进 永久 scrollback(markFirstAssistant 带 ⏺)+ finishHandled flag 缺 finish 时 补 [已取消](恢复 pre-1.21.1 final-drain-preserves-text)。codex H-2:统一 isCancelledFinish predicate(FinishCancelled OR FinishError+context.Canceled) 给 marker render + snapshot adoption,防 err-cancel 覆盖 lastSnapshot。 go-reviewer MED-1:segBuf strings.Builder(O(n²)→O(n))。+ 回归测 CancelMidSegmentRecoversPartial / NormalFinishNoSpuriousCancel / H-2 snapshot。 gate 全绿 + -race -count=10。 Spec: spec-1.21.1-stream-ordering-fix.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements spec-1.21.1 stream ordering fix.
Verification