Repository navigation
Conversation
…o longer scrolls the chat followUp appended every follow-up to the end of saying, carrying and attaching, queued or sent now. The rest of the chat takes the last queue.count of them as the queue's, and acknowledgements take from the front, so with Q1 and Q2 queued an Enter on S showed S as Q1, with Q1's labels and attachments. A message sent now now goes ahead of the queued ones (yetanotherbrowser#1029). The transcript followed saying.count down to the end, so a queued message scrolled it as a send would. It now follows Session.unheard, the words sent and not yet heard back, which a queued message leaves alone (yetanotherbrowser#1030).
[Medium impact] The PR appears safe to merge, with the previous scrolling finding addressed and no new actionable issues found. SummaryThe PR keeps messages sent immediately ahead of queued messages, with their own labels and attachments.
Reviews (2) · Last reviewed commit: "A message the queue lets go scrolls the ..." · Reviewed by Greptile |
Claude Code and Cursor say a released message back the moment it goes: turned takes it off the queue and send's acknowledgement takes its words off saying in the same step, so saying.count - queue.count never moved and the transcript stayed where the reader was. Session.sends adds the words heard back since the session was made, so a send is still counted once acknowledged. A session revived from a saved chat starts at zero, so opening one or picking its model does not scroll it.
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 changes
With messages queued behind a running agent, pressing Enter on a new message now shows that message, with its own attachments, instead of the first queued one. Queueing a message with ⌘Enter no longer scrolls the conversation to the bottom; a message that is actually sent still does.
Fixes #1029
Fixes #1030
Why it happened
The chat keeps your words for messages still to be heard back in
saying, with their labels incarryingand their attachments inattaching. The lastqueue.countentries are taken as the queue's (ChatTranscript.swift:113,unqueueatChatColumn.swift:2917,sendNowatAgents.swift:2665), and acknowledgements take from the front (Agents.swift:657-660, andAgents.swift:3647-3649for Codex).Agents.followUp(Sources/Fast/ChatColumn.swift:2953-2957) appended every follow-up to the end of all three arrays, queued or sent now. With Q1 and Q2 queued and S sent with Enter, they held[Q1, Q2, S]while S was acknowledged first, so S was shown as Q1, with Q1's labels and attachments. A message sent now now goes ahead of the queued entries. ⌘Enter still appends, and so does a Cursor steer, sincesteerappends it to Cursor's queue.ChatTranscript.body(Sources/Fast/ChatTranscript.swift:94) tooksentfrom the wholesaying.count, and.onChange(of: sent)(ChatTranscript.swift:285) treats any increase as a send: it setsfollow, clearsholdingandbelowand scrolls to the end. It now readsSession.sends: the sent words not yet heard back (saying.count - queue.count) plus those heard back since the session was made (Session.echoed). A queued message leaves it alone. Claude Code and Cursor say a message back in the same step the queue lets it go (turned, thensend), so the words heard back are counted too, or that send would not scroll. A session revived from a saved chat starts at zero, so opening one or picking its model does not scroll it.Proof
mainand passes here:swift test --filter 'ChatQueueTests'New tests in
Tests/FastTests/ChatQueueTests.swift, on a running Claude Code session whose stdin is a temporary file:aMessageSentNowIsShownWithItsOwnWordsAndWhatWentWithIt: queues Q1 and Q2, then sends S with a quote; S is shown with its own words, label and retry attachment, and Q1 and Q2 stay queued in order.queueingIsNotSendingButTheQueueLettingOneGoIs: queueing two messages leavessendsat 0; Claude Code's end-of-turn event, fed throughAgents.hear, makes the queue let Q1 go and Claude Code say it back, andsendsbecomes 1.With the two fixes undone (
followUpappending again, the marker returningsaying.count), on the first commit's version of the tests:The current tests against the first commit of this PR (b0278e5, where the marker was
saying.count - queue.countand missed a send acknowledged at once):With this branch:
Checked on
Checklist
swift testpasses (or the suites this touches: list them): ChatQueueTests, RemoteTaskFoundationTests, AgentArchiveLifecycleTests, ChatStreamStabilityTests, LiveStreamTests./design-check --headis clean, or each exception says why with// design:NativeActions.swift(no new menu item or Settings row)Not verified
Agents.swift:3647-3649) and the Codex steer paths have no test of their own. They take from the front of the same arrays, so the same order applies, but only the Claude Code path is tested.Not in this PR
unqueue(ChatColumn.swift:2918) removes the taken-back message fromsayingbut leaves its entries incarryingandattaching, so later messages can show the wrong labels and retry with the wrong attachments.dispatchAllowedrefuses leaves its words insaying, where the next acknowledgement can pick them up.