Skip to content

Chief chat (Mac Home): bound the loaded window as replies arrive - #34840

Open
azooz2003-bit wants to merge 4 commits into
feat-cmux-nextfrom
chief-window-bound-home3
Open

azooz2003-bit wants to merge 4 commits into
feat-cmux-nextfrom
chief-window-bound-home3

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Mac Chief chat (Home: HomeStore → TranscriptWindow → MessagesLabHomeView) loaded every message that arrived while it was open and never dropped one. TranscriptWindow.apply only appends. Each change rebuilds the conversation's timeline from the whole window, so a Chief chat left open for days gets slower with every reply.

Now, when the reader rests on the newest message (pinnedToBottom && atNewest) and the window holds more than 1,500 messages, HomeProjection schedules HomeStore.trimIfResting for the next display frame. It keeps the newest 1,000. The cut moves up to keep:

  • every message a kept message answers (replyTo) or threads under (threadRoot)
  • the open thread, its drill path and the composer's reply target

Nothing is trimmed while an older page loads. The dropped history pages back in when the reader scrolls up (reachedStart goes false).

This is the real Mac half of the Chief chat window bound. #34493 changed MacConversationViewController, which only the conversation lab app uses, not the cmux-next Mac app. The iOS half is on feat-cmux-next (de82e16..7927578).

It also carries a one-word base fix: SidebarListStillTests used AvatarMotion.working, renamed to .thinking in #34416. That left the MessagesLab test package not compiling.

Changelog

Fixed: A Chief chat left open on the Mac no longer slows down as replies keep arriving.

Tests

HomeWindowBoundTests drives the real MessagesLabHomeView over a real HomeStore on the mock owner (HomeChatRig). It posts 1,600 Chief replies to an open chat resting at the newest message, in 32 batches with a display frame after each.

  • Red, test only, 9ab0b59 (fleet step 72bfc7b9442f49ace2bc2801): fails, loaded → 1640 <= 1500.
  • Green, head 4f67880 (step 04a66d08d5e7db9e5a68700f): passes, along with DragWhileStreamingTests, HomeChiefRetryTests and HomeComposerSendButtonTests.
  • TranscriptWindowTrimTests (keeps the newest, keeps answered, threaded and held messages, pages back in), HomeTranscriptPagerTests and StoreKeptTranscriptTests: pass.
  • Mac app fleet build e00d0dce1e20c5062a1b8e1a: passed, tag chief-window-home.

Capture

recordsTheLoadedWindowAsRepliesArrive renders the real view after each batch: before the fix the count climbs to 1,640; after it, it trims to 1,050 at batch 31 and ends at 1,100, still pinned at reply 1,600. The video and stills are in the report.

Observed / Not run

Observed: the runs above. Not run: a Chief chat left open for days in the real app against a live Chief.

HOLD: user dogfoods before merge.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

The Mac Chief chat left open at the newest message no longer grows without bound: the loaded window is trimmed while replies keep arriving, so each arrival stops rebuilding the whole timeline.

  • Above 1,500 loaded messages, the next display frame trims the window to the newest 1,000.
  • The cut keeps messages a kept one answers or threads under, plus the open thread's path and the composer's reply target, but never holds the window above 1,500, and re-reads agent runs for the window left.
  • Dropped history pages back in when the reader scrolls up; nothing is trimmed while an older page is loading.
  • Also fixes SidebarListStillTests to use the renamed AvatarMotion.thinking, which had left the MessagesLab test package uncompilable.

Written for commit 5505999. Summary will update on new commits.

View guided diff Turn on auto-fix

azooz2003-bit and others added 3 commits November 3, 2026 19:33
… from .working in #34416)

The rename left MessagesLabSidebarTests not compiling, which stops every
MessagesLab package test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as replies arrive

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts at the newest message

HomeStore's TranscriptWindow appended every live message and never dropped
one, so a Chief chat left open grew without limit and each change rebuilt
the timeline from the whole window. A view pinned at the newest message now
trims the window above 1500 to the newest 1000 on the next display frame
(HomeStore.trimIfResting), keeping messages that kept ones answer or thread
under and what an open thread or reply points at; the dropped history pages
back in when the reader scrolls up. Not while an older page loads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@azooz2003-bit azooz2003-bit added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 4, 2026
@cursor

cursor Bot commented Nov 4, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 5505999: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr34840 -f ref=chief-window-bound-home3 -f platform=macos -f backend_mode=local

…e agent runs

Review of the bound: what the trim keeps (messages kept ones answer or
thread under, what the view holds open) can no longer hold the window above
the trim threshold, so one reply to an old message cannot stop the bound for
good. A trim reads the agent runs again for the window left, and the view
checks the store's message count rather than timeline rows. The frame
recording test leaves the suite (its frames are in the PR's report).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 4, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@azooz2003-bit

Copy link
Copy Markdown
Collaborator Author

Correctness review (subagent) and resolution

Reviewed head: 4f67880. Fixes landed in 5505999.

# Finding (severity) Resolution
1 TranscriptWindow.trimOlder widens the cut to keep a reply or thread root that is still referenced. A very old root could keep the window above the limit forever (medium) Added the atMost: limit. The cut never keeps more than the threshold, and the anchors are kept only while they fit. Covered by TranscriptWindowTrimTests.whatItKeepsNeverHoldsTheWindowAboveTheLimit
2 agentMessages still held rows the trim dropped (medium) HomeStore.trimIfResting now calls requestAgentMessages(id) after the trim
3 The projection compared timeline rows with a message-count threshold, so the units did not match (medium) Added HomeStore.loadedMessageCount(in:), and the projection checks that count
4 The frame-recording test is heavy for a regression suite (low) Removed. The recordings stay as proof artifacts only

Receipts on 5505999:

  • Swift suites green: cmux-ci step 73d375ac3ea31b95b5f4b76d (MessagesLabHome HomeWindowBoundTests) and d80ecee230db39935f25a3c1 (CmuxHomeCore TranscriptWindowTrimTests)
  • App build green: fleet job 7da095abb1bef3192ef8c6d3, published as tag chief-window-home

Before and after on the Mac, in the real MessagesLabHomeView over a real HomeStore, after 1600 Chief replies:

  • before: 1640 messages loaded
  • after: 1100 loaded, still pinned to the newest reply

HOLD: the user dogfoods the build before this merges.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 55059991 Deployed Nov 4, 2026 by azooz2003-bit via namespace autofix #13999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant