Repository navigation
qt: a CLI's newest item shows when Core publishes it, not when its next one arrives - #2125
Merged
Merged
Conversation
…xt one arrives The Qt window followed only `CoordinationObserved`, which CLI drafts and finished items never change (they feed no thread status), so a CLI thread's view re-read its transcript only when some status change happened by. Measured on the live bus against this session's own CLI (tools/qt_drive.py cli_sync): an item reached Core in under 0.1 s and stayed off the Qt view for 4-33 s, until the CLI wrote its next item. The TUI already follows `ExternalTranscriptChanged`. Both toolkits now route that event through one owner, `SourcedConversation. external_transcript_changed`, which asks the view's operational sources to read: the Textual presentation calls it on its widget, and the Qt window calls it on every open view (shown or parked); a page without a transcript answers with nothing to read. After: 0.2 s and 0.6 s from Core's store to the Qt view, ahead of a direct Core read. Drive scenarios added: `cli_sync` (CLI transcript vs Qt rows vs direct Core reads, with a frame recording), `peer_profile` (ask a tailnet peer for a UI profile as the bus picker does) and `idle` (this process's CPU per thread while following a bus untouched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…ed its band Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
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.
What was wrong
A Claude Code session's DM view in the Qt app ran 4–33 s behind the CLI. Measured against this session's own CLI on the live bus with the new
cli_syncdrive. The drive times each marker token in four places: the CLI's JSONL, the bus store (draft and finished rows, read-only), a direct Core read every second, and the Qt view's rows.Before the fix, the bus had the item within 0.1 s, the observation services were idle (py-spy dump), and the Qt view only showed the item once the CLI wrote its next one.
Cause: the Qt window followed only
CoordinationObserved. That event fires for thread-status changes, and CLI drafts and finished items never change status (StatusView's own docstring says so). So a CLI thread's view re-read its transcript only when some unrelated status change happened to come along. The TUI already followsExternalTranscriptChanged.Change
Both toolkits route
ExternalTranscriptChangedthrough one owner,SourcedConversation.external_transcript_changed(the shared parent of Textual'sConversationandQtConversation), which asks the view's operational sources to read.widget.operational_sourcesispresentation.sources.Pagebase answers with nothing to read.New drive scenarios
cli_sync: CLI transcript vs Qt rows vs direct Core reads, with a frame recording.peer_profile: ask a tailnet peer for a UI profile, as the bus picker does.idle: this process's CPU per thread while following a bus untouched, plus the sidebar wave's repaint count.Gates (on 6dd4c36)
#composer-drive-missing.check.shwith PYTHONFAULTHANDLER=1: exit 0, no fatal or traceback lines. The realtoad.jsonwas not written.Not run
tests/textual/test_parked_session_tab_arrives_progressively.pycovers the Textual path. It can't run in any local test env: they fail on import becausetextual.actions.StyleActionis missing from the Textual checkout. The Textual change swapssources.external_transcript_changed(widget)forwidget.external_transcript_changed(), which resolves to the same call.Still in the lag (not this PR)
Claude Code itself writes a message's JSONL line up to about 9 s after the message's own timestamp, while a following tool call runs. No client can show the item before that write.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3