Skip to content

cmux NEXT: an agent-opened session workspace records its lineage parent - #24136

Merged
teamleaderleo merged 15 commits into
feat-cmux-nextfrom
cmux/lineage-workspace-parent
Oct 30, 2026
Merged

teamleaderleo merged 15 commits into
feat-cmux-nextfrom
cmux/lineage-workspace-parent

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Status: done. Codex xhigh SHIP at 1a61756; fleet compile-check --app passed at 1a61756; fleet suites AgentSessionLineageTests (8 tests), SidebarSessionTreeTests and RemoteChildSessionsTests all pass (run on 1a61756 on top of base 7d50820, because base's SidebarNowLineTests.swift has conflict markers that stop every CmuxNext test build).

Leo: "LIKE E.G. AGENT SESSION CREATION LINEAGES... CLAUDE CODE MOSTLY JUST HAS ONE LAYER... WHAT IF WE DID MORE? OR DIFFERENT?"

Leo-ask: ask-19882abbc3

Session lineage, PR 2 of the plan (app: an agent-opened session workspace records its parent).

What changes

  • agent.openSessionWorkspace (cmux agent open, acpmux new --group, the MCP open tools) passes the invocation's callerAgentSession through to open(...). Once the chat tab opens, it records that caller as the opened session's lineage parent in a new AgentSessionParents store (child session -> parent session, kept in UserDefaults under cmux.next.agentSession.lineageParents, capped at 4096, oldest dropped). A person's open (no caller), a blank caller, or a session naming itself records nothing.
  • The re-homed-lane reuse path (a tab in the predecessor's row) records the parent too.
  • SidebarSessionTreeFeed.pass reads the recorded parents as a fallback, applied last and never where it would close a loop: a workspace gets its recorded parent only when neither the remote daemon's startedBy/spawnedBy (RemoteAgentSessionLinks) nor this Mac's lane spawnedBy names one. Daemon lineage always wins.
  • The field is named parent to match the acpmux lineage summary field (parent/root/depth) another lane is adding; this PR does not depend on it.

No default changes. The tree itself stays behind sidebar.sessionTree (off by default). No sidebar layout or fold changes (#21836 owns those; this touches only pass(...)'s parents map, not the agentStates lines #21836 adds there).

Tests (test-first)

CmuxNextAppTests.AgentSessionLineageTests:

  • opening with a caller session and no daemon lineage (local older daemon, and remote) nests the workspace under the caller's;
  • a person's open records nothing;
  • daemon lineage (local spawnedBy, remote startedBy) wins over the recorded parent;
  • recorded parents survive a relaunch and the newest record wins;
  • a record that would close a loop is refused, in the store and against the daemon's lineage in the tree.

No capture: records data only; the nested view stays behind sidebar.sessionTree until the nesting PR

🤖 Generated with Claude Code

Agent session: cosmic-gray

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 67c53ff: 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=pr24136 -f ref=cmux/lineage-workspace-parent -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: Prebuilt web bundles install and stamp (+2 more) is not red on the base 6c1a984; do not merge until green; see lane-rules

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41006843682 at 346179f failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at d850860. This pull request is one of 2 merged since: #27163, #24136.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@teamleaderleo teamleaderleo added the risk:low Risk tier (docs/ci/risk-tiers.md) label Oct 22, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-em5dh created for this PR by the cmux coordinator.

@github-actions github-actions Bot removed the risk:low Risk tier (docs/ci/risk-tiers.md) label Oct 22, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Found 9 test failures on Blacksmith runners:

Failures

Test View Logs
--from must install a complete prebuilt tree/
--from must install a complete prebuilt tree
View Logs
/tmp/tmpd6lilbox/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpwsm3t7kn/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)/
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)
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.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 22, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex xhigh, correctness first): SHIP at e41dd19

Findings: None.

Non-blocking: Tests do not directly exercise ObservationStream invalidation or end-to-end ActionInvocation.callerAgentSession wiring.

Verification: dependency-list, concurrency, and diff checks passed. Swift compilation/tests were unavailable because no Swift toolchain was installed; no macOS app build was run.

(Verbatim reply of the Codex xhigh reviewer session huge-blue/sv2-review-24136, relayed by the PR owner because GitHub was rate-limited for the reviewer. Its earlier BLOCK at 934d513 — a daemon parent no workspace shows did not win over the recorded parent — is fixed in e41dd19 with test aDaemonParentNoWorkspaceShowsStillWins.)

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / nightly-guards / workflow-guard-tests / release-notary is red on 13 of 17 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / tooling-tests is red on 17 of 17 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@cursor

cursor Bot commented Oct 22, 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 xhigh, correctness first): SHIP at 1a61756

Non-blocking: tests still do not exercise the actual open/reuse task wiring or 4096-entry eviction.

(Verbatim reply of the Codex xhigh reviewer session cosmic-gray/sv2-review4-24136, which had no tool or GitHub access and reviewed the inlined diff; relayed by the PR owner. Its BLOCKs at f99d9cd (cycles among recorded parents) and f19894d (a recorded parent looping with daemon lineage) are fixed in f19894d and 1a61756 with tests aRecordThatWouldMakeACycleIsRefused and aRecordedParentNeverLoopsWithTheDaemonsLineage.)

@teamleaderleo teamleaderleo added ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds and removed ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds labels Oct 22, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Checks job structure is red on 11 of 12 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › No fleet host names in gallery fixtures is red on 11 of 12 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next crash-class rules / cmux-next crash-class rules is red on 9 of 10 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › No new SwiftUI (macOS UI is AppKit) is red on 16 of 18 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 13 h, and no lane holds a lease on it. Adopted by the orphan sweep: merged feat-cmux-next in at f8186a3. A later pass queues it for the merge hub if it is reviewed, small and red only on base reds.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Script tests (pin-cmux-tui, embed-cef, ensure-cef store) is red on 14 of 15 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next swift test is red on 10 of 14 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

teamleaderleo commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

Review P2 at cc78a79: opening an unopened remote child checks its lineage
under the daemon's registry host (AgentTabStore.registryHost(of:)), but the
wire noted links under the tab's record.host. A chat made on that Mac keeps
an install:<id> host, so its children were noted under install: and looked
up under registry:, and the open was refused. The tab's remote host now
carries the daemon's registry host (linksHost), and the wire notes each
reply's links under both. The tree and the pane keep reading record.host.
anInstallTabsChildrenAreNotedUnderTheDaemonsStoreHostToo covers it.

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

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

… host:) and the RemoteAgentSessionLinks import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-5b0be570f0b96d2d4c7b
# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextApp/Handlers/AgentSessionWorkspace.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.

…ck legacy links

- A host-qualified wire notes even an empty child list, so a daemon with no
  lineage gets its own map and never reads another daemon's hostless links.
- The wire records a tab's install: host and the daemon's registry: host as
  aliases; the sidebar's owner, daemon-link and recorded-parent lookups try
  the daemon's other keys, so a child nests under a parent keyed by the other.
- holds and chat.offer.open on a remote route with no hostID read the
  hostless map that route's wire noted, instead of refusing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-5b0be570f0b96d2d4c7b
A restored remote tab whose wire has not reported yet had no host map, so
its lookups fell back to the hostless map and could borrow another daemon's
link for a reused session id. Host-qualified lookups (offer open, side chat,
the sidebar's tree) now read only that host's map; the hostless map serves
only a route with no host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-5b0be570f0b96d2d4c7b
# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextApp/Handlers/AgentSessionWorkspace.swift
Comments only: every app wire notes under its tab's host, so the hostless
map holds only a hostless route's links; a remote child open with no store
id yet is refused because its tab could not be filed under that store.

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high fast, review-router): SHIP at 67c53ff
Fixes the three P2s (no hostless fallback for host-qualified lineage lookups, install:/registry: alias resolution in the sidebar tree, hostless routes read the legacy map) plus a clean merge of feat-cmux-next; fleet suites AgentSessionLineageTests, SidebarSessionTreeTests, RemoteChildSessionsTests, AgentPaneOfferOpenTests, CloudStartSessionTests, CloudCredentialRecoveryTests, AgentSessionWorkspaceChatOnlyTests pass at this head (cmux-ci step 7fa991c1fcee9a299212ceeb).

@teamleaderleo
teamleaderleo merged commit 346179f into feat-cmux-next Oct 30, 2026
148 of 154 checks passed
@teamleaderleo
teamleaderleo deleted the cmux/lineage-workspace-parent branch October 30, 2026 05:09
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 67c53ffb Deployed Oct 30, 2026 by teamleaderleo via cmux-tui tree preflight #80574
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