Skip to content

fix(acpmux): preserve peer ownership for session lifecycle commands - #27018

Merged
teamleaderleo merged 26 commits into
feat-cmux-nextfrom
lane/hb-mesh-start
Oct 29, 2026
Merged

teamleaderleo merged 26 commits into
feat-cmux-nextfrom
lane/hb-mesh-start

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Session lifecycle commands could discard the owning peer after resolving a target or select a local session when a peer shared its name. Resume, retry, cancel and stop now resolve one stable session ID, retain its peer route, and refuse ambiguous names with qualified candidates. Remote starts retain that route for initial prompts, follow-up reads, cleanup and group opening.

Requested behavior: "if we don't have good enough tooling in order to have things communicate, in order to start things, to resume things, to keep track of things, then we need to improve that."

TUI selection, incoming events, sorting and refreshes use the same peer-qualified identity. CLI send, quiet collection, plain attach, matching waits and live tail also preserve peer ownership when raw IDs collide. Target authorization and start-policy rules remain unchanged. RPC not-found codes preserve mesh-send fallback without treating ambiguity or internal failures as missing sessions.

Head: 97fe72c9ec3734e4f39183796bda53967d4e3092, rebased onto 9d8337eb4f9d93e9c061be1a208ca9bd5e288d3c after #27284. The phone-table regeneration is removed from this diff. The eight-line API compatibility surface update is official generator output for the base schema's optional new-pane-right.side enum. No schema or authorization implementation changes are included.

No capture: this is a CLI/TUI routing correction and compatibility snapshot update, with no native/web UI layout or styling change. Headless TUI tests exercise peer identity collisions.

Validation at this head:

  • The late Swift test job 123327754439 failed during Build package and tests, before tests and generated-output checks ran. Dependent generated-files job 123330548821 consequently has no verdict. Its exact compiler error is BrowserEntryRetirementTests.swift:43:57: returning main actor-isolated '$0.some.chrome.some' as a 'sending' result risks causing data races on Xcode 26.6. The file is unchanged by this PR and came from base PR fix(next): retire browser pages before chrome teardown #27166. The same package/test build at base 9d8337eb4f9d93e9c061be1a208ca9bd5e288d3c reproduced the identical diagnostic 25 times on Xcode 26.6: fleet cmux-ci step ac19bf2e04980ab5cd83a81e, exit 1. This matches the PR job line for line. The repair is tracked in test(next): BrowserEntryRetirementTests compiles again (base red from #27166) #27301. This PR changes no Swift or Packages/ files, so the base compile failure hides no signal for its acpmux surface; the focused acpmux checks and Release compile pass independently. The dependent generated-files failure is solely a consequence of this base compile failure.
  • Release-notary comparison: run 40840886491, job 1218d5af5a814f10819725d7cefe7aa2, proves identical head/base failure in DigestTests.test_the_repository_highlights_validate at test_digest.py:89 (invalid repository highlight entries). This explains the release-notary and dependent Guard status failures.
  • Fleet Release compile passed: run 40838054699, job 123327658683. Generated-files guard job 123327435937, generated-drift job 123327832713, and API compatibility job 123327434882 also pass.
  • Focused validation passed: run 40838104184, job 0cf6aaaf1ffb46a1b526c7f3de2c8857. The receipt confirms this exact head and tree dfa52bb8506dfcc9009ffa15e4c802ed9f54c7c0, exit 0. It ran API compatibility, Clippy with --all-targets -- -D warnings, and focused TUI, resolver, RPC fallback, peer lifecycle, remote groups/start policy, resume/retry, steering, CLI ergonomics and relay CLI tests.
  • Exact base comparison: run 40838108740, job cc303897f12f43f0aa486f7129abab57, passes. It reverses the full PR diff and verifies base tree 8be7a87f293d1bd7a69ca35bac52e2d24609a174 before running the same checks. Identical diagnostics and exit codes are asserted for each failure: test_ir.IrTests.test_live_raw_v12_layout_and_history_contracts_are_exact, subtest command='new-pane-right', at test_ir.py:384; the stale phone-field table; and the existing SwiftUI imports in HomeChatColorsPanel.swift and HomeChatColorsView.swift.
  • generated-files guard: a regeneration from the base's inputs is not a hand edit #27284 fixed the generated-files guard but did not regenerate the base phone table. This PR leaves that table exactly as on base. These named base failures do not hide the focused acpmux checks above.
  • Fresh independent Astra high/fast review: SHIP at 97fe72c9ec3734e4f39183796bda53967d4e3092; no actionable correctness or security findings. Both earlier review fixes hold.

Regression evidence (tests added before the corresponding fixes):

Regression Red run Job
Selected peer transcript misses a remote event 40820453945 49f75cf5556e4d718c75270ef5d0d39f
Peer lifecycle/ID collision on base production 40820731507 67d49d0150934dedbf0506824fce2a47
Streamed send consumes local output for a peer 40823667530 69beb03c1a834d48a73757bfc8ffee99
Matching wait times out after remote text arrives 40830761793 3db7d4e1e9bd408cbf51eb003bef6902
Initial TUI selection chooses a peer sharing the local raw ID 40835480072 8cade2657d55473aaf221bb886599a4a
Missing-peer RPC error suppresses relay fallback 40835586831 bae75089ce694ee0bd592f4814ed15d7

All corresponding regressions passed at the pre-rebase head in run 40835689741, job 32efb93f0c0c4bc19d75737e23f7f4ee. The final-head validation above repeats them after rebase.

Risk: duplicate names require a qualified target. Live peer routing requires the updated daemon's owner metadata. The approximately 1,160 changed lines stay together as one routing change with end-to-end coverage for starts, prompts, held queues, cancel/stop/retry, ambiguity, ID collisions, groups and TUI/CLI consumers.

The overlap tool could not read open PRs because its GraphQL invocation is unsupported by the broker. Earlier manual searches found no matching fix; related remote-start #26998 and policy-change #26987 touched different files. Relay control remains separate work using the shared relay client now on base.

Agent session: agent session

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

Copy link
Copy Markdown
Collaborator Author

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

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 97fe72c: 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=pr27018 -f ref=lane/hb-mesh-start -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 9d8337e to compare; do not merge until green; see lane-rules

@blacksmith-sh

blacksmith-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Found 9 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpokxs_b8l/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpq0ewkcwu/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_live_raw_v12_layout_and_history_contracts_are_exact (test_ir.IrTests.test_live_raw
_v12_layout_and_history_contracts_are_exact) (command='new-pane-right')/
test_live_raw_v12_layout_and_history_contracts_are_exact (test_ir.IrTests.test_live_raw
_v12_layout_and_history_contracts_are_exact) (command='new-pane-right')
View Logs
test_live_raw_v12_layout_and_history_contracts_are_exact (test_ir.IrTests.test_live_raw
_v12_layout_and_history_contracts_are_exact) (command='new-pane-right')/
test_live_raw_v12_layout_and_history_contracts_are_exact (test_ir.IrTests.test_live_raw
_v12_layout_and_history_contracts_are_exact) (command='new-pane-right')
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 (subagent, correctness first): SHIP at 97fe72c. No actionable correctness or security findings; both earlier fixes hold.

@teamleaderleo
teamleaderleo merged commit 4519676 into feat-cmux-next Oct 29, 2026
291 of 303 checks passed
@teamleaderleo
teamleaderleo deleted the lane/hb-mesh-start branch October 29, 2026 08:41
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

lawrencecchen added a commit that referenced this pull request Oct 29, 2026
…s no peer

#27018 made Hub::resolve answer a key under a configured peer's name with
"no local session with the id …", which a peer connection could tell apart
from the answer for a name that is no peer ("no session matches …"), so it
learned this host's peers (peer_state_origin
a_peer_connection_hears_nothing_of_a_down_peer_in_a_refusal). It also stopped
cmux-tui-core's prompt withdraw from reading the answer as no session here.
The refusal is not_found with the resolver's usual wording again; the route
rule of #27018 is unchanged.
lawrencecchen added a commit that referenced this pull request Oct 29, 2026
…s no peer

#27018 made Hub::resolve answer a key under a configured peer's name with
"no local session with the id …", which a peer connection could tell apart
from the answer for a name that is no peer ("no session matches …"), so it
learned this host's peers (peer_state_origin
a_peer_connection_hears_nothing_of_a_down_peer_in_a_refusal). It also stopped
cmux-tui-core's prompt withdraw from reading the answer as no session here.
The refusal is not_found with the resolver's usual wording again; the route
rule of #27018 is unchanged.
lawrencecchen added a commit that referenced this pull request Oct 30, 2026
…s no peer

#27018 made Hub::resolve answer a key under a configured peer's name with
"no local session with the id …", which a peer connection could tell apart
from the answer for a name that is no peer ("no session matches …"), so it
learned this host's peers (peer_state_origin
a_peer_connection_hears_nothing_of_a_down_peer_in_a_refusal). It also stopped
cmux-tui-core's prompt withdraw from reading the answer as no session here.
The refusal is not_found with the resolver's usual wording again; the route
rule of #27018 is unchanged.

This branch was previously deployed

3 inactive deployments
artifacts — 97fe72c9 Deployed Oct 29, 2026 by teamleaderleo via add the Windows daemon to the tree #75657
ci-routing-agent — 97fe72c9 Deployed Oct 29, 2026 by github-actions[bot] via cmux-next macOS placement #45038
sentry-dsyms — 97fe72c9 Deployed Oct 29, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #75657
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