cmux NEXT: a banner with Show for a tab an agent marked

Closed
TE
3d ago
+8431-4466

Leo, 2026-10-22:

idk where things are man i dont see anything other than the current workspace which is you and you have a cmux next github brwoser tab open (we need to have cmux expose this harder if it isn't already/hve better instructions)

Leo-ask: ask-12231fbe5e

This is the fourth slice of "needs you here", after #24286 (daemon mark and CLI), #24311 (blue dot and ring) and #24336 (Needs you item and Go to What Needs Me). When an agent marks a tab with cmux attention request --tab T --reason R, the app posts one system banner per request:

  • Title: "Workspace › Tab", by titles, never ids.
  • Subtitle: "Needs you".
  • Body: the agent's reason.

Show (or a click on the banner) goes to the tab through the same Go to that Needs you and the palette use (AgentPaneAttentionTabs.open, then revealTab). Posting the banner moves no focus.

  • The banner follows notifications.* the way an agent notification does: desktop mode, muted workspaces, quiet hours and sound (NotificationPolicy).
  • A mark that was made before this launch posts nothing.
  • When an agent sends a new request on a tab that is already marked, the old banner is withdrawn and a new one posts.
  • When the mark clears (the agent clears it, the page changes, the tab closes), its banner is withdrawn.
  • AttentionTabsWatch (from #24336) drives this. Nothing polls.

This depends on #24336, and its commits are in this branch. After #24336 lands, this diff is 154 lines plus translations for the two strings ("Needs you", "Show").

Changelog

Added: A system notification with a Show button when an agent needs you in a tab.

Tests

Tests/CmuxNextAppTests/AttentionBannerTests.swift covers:

  • One banner per request. None for marks made before launch. A new request replaces the banner. A cleared mark withdraws it.
  • The banner id names only its tab.
  • Show goes to the tab through Go to, and posting moves nothing.
  • The category has a foreground Show action.

Observed / Not run

  • Observed:
  • Not run here: the Swift test suite, which runs in PR CI. A live banner was not captured: CI minis run as automation launches, which never create the notification center.

Agent session: cosmic-gray

šŸ¤– Generated with Claude Code


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


Summary by cubic

Posts a system notification with a Show button when an agent marks a tab as needing you (cmux attention request), so a request reaches you beyond the tab list and sidebar dot.

The banner titles the tab by its workspace and tab titles (never ids), shows "Needs you", and carries the agent's reason. Show or a click goes to the tab through the same jump Needs you and the palette use; posting moves no focus. Marked tabs are keyed by a 16-hex digest of their machine and tab id, so rows, jumps, and banner policy read the machine that owns the tab — a forked machine sharing a tab id never shows or hides another's, a Go to whose workspace id this Mac's workspace also has (a cloned machine) refuses it, and Show opens the tab only while that banner's request is still a live mark, so a banner from an earlier launch or one a newer request replaced opens nothing.

Banners follow notifications.* like agent notifications — desktop mode, quiet hours, and sound, with workspace mutes keyed by the owning machine so a cloned id's settings never cross machines — and are driven by AttentionTabsWatch, so nothing polls. A new request on an already-marked tab replaces its banner; a cleared mark, navigation, or tab close withdraws it, and an open palette page drops or adds its row as the marks change. Marks made before this launch post nothing. attention.goTo is a focus action, so an agent-origin cmux action run attention.goTo refuses unless focus was requested, and a Go to from a marked tab's row (chat.attention.open, now on the page host allowlist) spends the pane's one-use user gesture, so page script alone cannot show a tab.

Changelog
Added: A system notification with a Show button when an agent needs you in a tab.

Bug Fixes

  • A click or key in a Cloud or SSH tab now hides its ring only on the machine that owns the tab, and a mark with a malformed at_ms is no mark.
  • A key in another machine's terminal no longer clears a local workspace's manual Mark as Unread when their tabs share an id.
  • A mark posts only once its machine's live tree and current session snapshot arrive; a request arriving as a reconnect delta is retained through readiness and posts when eligible even if the lifecycle already saw it as unready, and a replaced or replayed store re-baselines without silencing ready machines.
  • A request during the typing quiet period stays silent, keyed by machine and tab so another machine's cloned tab never quiets it.
  • AppServices now owns the watch, so releasing the services cancels its observation loop.