Skip to content

mu-9bri/mu-b20l solo: chronological queued-prompt commits + tracked finalize (no more stutter)#491

Merged
sahuagin merged 2 commits into
mainfrom
cc/mu-9bri-transcript-fidelity
Jul 14, 2026
Merged

mu-9bri/mu-b20l solo: chronological queued-prompt commits + tracked finalize (no more stutter)#491
sahuagin merged 2 commits into
mainfrom
cc/mu-9bri-transcript-fidelity

Conversation

@tcovert-c137

@tcovert-c137 tcovert-c137 Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Two transcript-fidelity fixes from live operation (sessions 64dcebc762f83eb9), fixing mu-b20l and mu-9bri.

mu-b20l — assistant text duplicated around every tool call ("the stutter")

Every text preceding a tool call rendered twice: above the marker and again between it and the result. The event log shows one canonical text block per message — pure render artifact. The wire orders text_delta…tool_call_startedassistant_text_finalized, so at finalize time the trailing item is the ToolCall; the old last-item-only check appended the canonical text instead of replacing the streamed item.

Turn now tracks the in-flight streamed item by index (streaming_text_ix / streaming_thinking_ix): deltas extend the tracked item, finalize swaps it for the canonical text and ends tracking, and a finalize whose invocation streamed nothing pushes fresh instead of clobbering an earlier invocation's already-canonical item. Applied to both text and thinking channels; order-independent.

mu-9bri — queued prompts commit in chronological position

A prompt queued mid-turn committed below the whole finished turn, so the part of the turn that answered it rendered above the question (observed with a prompt typed during a blocking dialogue_poll). PendingInterjection now captures the live turn's item count at queue time, and the commit interleaves per plan_splice_commit: items before the splice → the prompt (keeping its queued-while-responding label) → the items that answered it.

Deliberate granularity: the item boundary is authorship-correct, not an approximation — deltas still streaming into the in-flight item come from a provider call that never saw the prompt (absorption injects it at the next InvokeLlm), so the answer necessarily begins in a later item. Bridge-gap prompts (no live turn at queue time) resolve to the next spliced prompt's position when one follows — a panel round-3 finding, fixed and pinned in tests — and to the legacy after-the-turn position otherwise. Turns with no spliced prompts keep the single-block commit path byte-for-byte. Settlement bookkeeping (mu-z9ol receipts) is unchanged.

Verification

  • 153 mu-solo tests green, including new coverage: tracked-finalize across trailing tool calls, no-delta finalize non-clobber, splice-plan chronology and edges (start/past-end/same-point/mixed bridge+mid-turn both orders).
  • Full just ci green.

Gate

just ci-aipr: first panel escalated with gpt-5.5 holding a mixed-case planner objection; the objection was correct, got fixed (the [None, Some(k)] resolution above) and pinned in tests, and the re-gate converged unanimous approve in 1 round.

🤖 Generated with Claude Code

https://claude.ai/code/session_01REB3QZvP3arA2cLMVRgYam

claude (aiteam) added 2 commits July 14, 2026 15:30
…s text around tool calls

Every assistant text preceding a tool call rendered twice: once above
the ● marker, once between it and the ⎿ result. The event log shows one
canonical text block per message — pure render artifact.

The wire orders text_delta… → tool_call_started →
assistant_text_finalized, so at finalize time the trailing item is the
ToolCall; the finalize arm only replaced items.last_mut() when it was
Text and otherwise APPENDED the canonical text after the tool marker.

Turn now tracks the in-flight streamed item by index
(streaming_text_ix / streaming_thinking_ix): deltas extend the tracked
item, finalize swaps it for the canonical text and ends tracking, and a
finalize whose invocation streamed nothing pushes a fresh item instead
of clobbering an earlier invocation's already-canonical one. Applied to
both the text and thinking channels; order-independent.
…ion above its answer

A prompt queued mid-turn was committed BELOW the whole finished turn,
so the part of the turn that answered it rendered above the question
(observed with a prompt typed during a blocking dialogue_poll: the
in-turn answer sat above the prompt it answered).

PendingInterjection now captures the live main turn's item count at
queue time (splice_at). On a finished main turn, the commit interleaves
chronologically per plan_splice_commit: turn items before the splice,
the prompt block (keeping its queued-while-responding label), then the
items that answered it as a follow-on assistant block. Bridge-gap
prompts (no live turn at queue time) keep the legacy after-the-turn
position, and turns with no spliced prompts keep the single-block
commit path (with its finalize-mismatch diagnostic) byte-for-byte.

Settlement bookkeeping is unchanged: the interleaved path returns the
same unsettled still-owed ids as the drain-all path (mu-z9ol).
@sahuagin sahuagin merged commit 30b02d0 into main Jul 14, 2026
5 checks passed
@sahuagin sahuagin deleted the cc/mu-9bri-transcript-fidelity branch July 14, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant