Skip to content

cmux NEXT: defer first Cmd-N until cold sidebar anchor is realized - #27014

Merged
teamleaderleo merged 27 commits into
feat-cmux-nextfrom
codex/cmdn-cold-followup
Oct 31, 2026
Merged

teamleaderleo merged 27 commits into
feat-cmux-nextfrom
codex/cmdn-cold-followup

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked follow-up to #25654 for the first Cmd-N after a cold/update layout.

When the sidebar projection is stale and the current workspace row has not been realized, afterCurrent now keeps the placement pending and draws no temporary bottom frame. Once the fresh sidebar pass realizes the anchor, the pending create is retried and inserted immediately after the current workspace. The default rule captures the current machine so omission on another machine does not defer unrelated placement.

Changelog

  • Fixed the first Cmd-N after update/cold layout so its row appears directly after the current workspace without a bottom frame.

Validation

  • Red regression (pre-fix SHA 9578cd596c0d192ee8db1dcbf0858bda5a6466e5): cmux-ci step 7a6e1ad7a7a0184eefcb9128 (running; expected failure).
  • Prior managed baseline step 4934f43cdecc4be8a49466a4 on 8129deaa308961fdaaad663f30802e2152348c7b: suite passed, showing the original integration test did not catch the stale empty projection.
  • Swift syntax gate against cmux NEXT: keep the first Cmd-N workspace in its slot #25654: passed.
  • Full static gate: blocked by existing localization debt (45,715 parity errors; no localization files changed here).
  • Green focused suite will run on the final fix head after the red receipt is terminal.

No changes to Lawrence #21914 or Austin #23071. No visual styling or motion changes; matched the Codex quiet sidebar reference (apps/codex/live/sidebar-active-work-projects-recents.png, Sidebar-Look: no visual change). #25654 still has no usable NIGHTLY display-rate recording; this regression uses an explicit stale-projection state.

No capture: this changes when a new workspace's row is placed on a cold launch, not how anything looks; ColdCmdNRowSlotTests records every drawn sidebar frame and checks the new row sits right after the current one in each.

Agent session: agent session

@teamleaderleo
teamleaderleo force-pushed the lane/nx-sidebar-cold-cmdn branch from a6f4815 to 0ae497c Compare October 29, 2026 21:02
Base automatically changed from lane/nx-sidebar-cold-cmdn to feat-cmux-next October 29, 2026 21:39
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 29, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): BLOCK at 290df63

  • [P2] Packages/macOS/CmuxNext/Sources/CmuxNextApp/Windows/NewWorkspaceDefaultSlot.swift:42–47: A current workspace pinned in the sidebar band is intentionally absent from sections. This predicate mistakes that absence for a stale layout, suppressing the new workspace’s stand-in and leaving its placement and completion callback pending indefinitely while the anchor remains pinned. Preserve the documented top fallback for pinned workspaces; defer only anchors expected to appear in the row list.

@teamleaderleo

teamleaderleo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Review ba200c3: 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=pr27014 -f ref=codex/cmdn-cold-followup -f platform=macos -f backend_mode=local

Not verified: macOS jobs did not run: compile and app tests were skipped on 75a3832274; ci-status is green without them.

CI passes on 75a3832274 (run 41145201665 attempt 2).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

web and size checks: green

Default changes

This pull request changes 2 defaults at 75a3832274a3 (what everyone gets without configuring anything):

  • tunable-source.CmuxNextApp/Windows/NewWorkspaceDefaultSlot.swift:rule: "b11fd37b056c64ae11b89e0ad147ef5e0a4d519cd23cc12916a0afe5c02e3cb2" -> "01cd762676ba0dfbf816c76299051a9b85ed40d8f6f19a8b1e6cb9452dd9e3e5"
  • tunable-source.CmuxNextApp/Windows/NewWorkspaceDefaultSlot.swift:shownInBand: (none) -> "f6ae04b2fa867c42239acbf81639f8624af914c3af18665a4bf3322b40e59d3d"

Signed off on this commit by review (codex gpt-6.1-sol high, review-router).

Merge receipt: merged as 58af48e51d89 with these defaults changed, signed off by review (codex gpt-6.1-sol high, review-router).

Regenerate the snapshot with python3 scripts/ci/defaults_guard.py snapshot.

Shipped in:

@blacksmith-sh

blacksmith-sh Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Found 5 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): BLOCK at a0211a5

  • NewWorkspaceDefaultSlot.swift:42-46 — awaitsCurrentAnchor treats every missing same-machine current row as a transient cold projection. Top-level pinned/top-band (and custom-band) workspace rows are intentionally removed from the machine SidebarRowSections, so afterCurrent for a currently pinned workspace always returns true. PendingWorkspaceRows.adding suppresses the stand-in, while WindowManager+Placement.swift:35-36 keeps the placement pending forever; the new workspace remains at the daemon’s default position and any then callback never runs. The check must distinguish intentionally hidden anchors from stale projections.

… placement

The list leaves pinned, top-region and custom-section workspaces out on purpose, so their absence
is not a stale cold layout: the press records no current machine for them, and the placement
pass stops waiting once the current workspace has been pinned since the press. afterCurrent then
falls back to top, as documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-0cf32b32a03b27dcdf4d
# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextApp/Windows/WindowManager+Placement.swift
@cursor

cursor Bot commented Oct 30, 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.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, review-router): SHIP at a154472. No P1/P2 findings. Fixes the two P2s of the d199d41 review with red tests at 393195c: freshness of the cold layout is now per window (each window records the projection its rows were built from), and a placement waits only when this window lists the current workspace, bounded at 3 s. Fleet at this head: ColdCmdNWindowRowsTests, NewWorkspaceBandRoomTests, PlacementStaleRowsTests, ChiefWorkspaceRowsTests pass; ColdCmdNRowSlotTests fails only firstColdCmdNWithRestoredFollowingRowsStaysAfterCurrent, which fails the same way on base 7a70781.

# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextApp/SidebarBridge+Intents.swift
teamleaderleo and others added 2 commits October 30, 2026 08:35
…pace is gone

Sidebar-Look: no visual change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-0cf32b32a03b27dcdf4d
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, review-router): SHIP at ba200c3. No P1/P2 findings. Since the a154472 SHIP: a base merge (one conflict in SidebarBridge+Intents.swift resync, both sides kept) and the fix for the a4bd66e review P2 (a placement waiting on its anchor whose workspace closes is dropped), red test at 273f097. Fleet at this head: ColdCmdNWindowRowsTests, NewWorkspaceBandRoomTests, PlacementStaleRowsTests, ChiefWorkspaceRowsTests, ColdCmdNRowSlotTests all pass.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, review-router): SHIP at 378f4e0

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, review-router): SHIP at 75a3832

No P1/P2 findings on the full diff from base d9461de (head is a clean base merge onto 378f4e0).

@teamleaderleo
teamleaderleo merged commit 58af48e into feat-cmux-next Oct 31, 2026
155 of 159 checks passed
@teamleaderleo
teamleaderleo deleted the codex/cmdn-cold-followup branch October 31, 2026 01:56
lawrencecchen added a commit that referenced this pull request Nov 1, 2026
… rows pass runs (#31069)

CmdNRowSlotTests, CmdNInGroupRowSlotTests (3 of 4 cases) and
ColdCmdNRowSlotTests (intermittent, 3 of 5) were red on feat-cmux-next.
Austin's report: a new workspace row draws at the end of the list, then
moves to its slot.

Event order in the failing runs (SLOTDBG trace, job c8b7e3ff4e954c8e515b260c):
1. The press draws the pending row at its slot.
2. Reconcile: the daemon's workspace is live in the store;
   applyPendingPlacements takes its entry and clears it.
3. The placement's own refresh (placementSections, sameTurn.syncNow) runs
   a rows pass before the move is sent. The sidebar document does not
   place the item yet and does not lag (version == shownVersion), so
   PendingWorkspaceRows.listing listed the workspace's own row at the
   daemon's place (the end) and forget dropped the pending row. That frame
   was drawn.
4. bridge.place sends the move; the next frame has the row at its slot.
A passing run is one where the store still showed the stand-in at step 3.
The race is old (red at 58af48e, #27014, and at every later point
tried), not a recent regression.

Fix: a workspace whose slot WindowManager.pendingPlacements holds keeps
its pending row at that slot until the placement is sent. The entry is
cleared after the refresh, right before the move, and the observed
PendingWorkspaceRows.unsentSlots (kept per id from pendingPlacements'
didSet, so two apps in one process do not overwrite each other) re-runs
the rows pass when it goes, also for a placement that sends no move.
An anchor wait now updates its entry in place instead of clearing and
setting it again. No wait, retry or delay.

Line-neutral in CmuxNextApp (arch-ratchet app_lines).

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 75a38322 Deployed Oct 30, 2026 by teamleaderleo via wait for same-key tree publisher #85724
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