acpmux: a peer's _acpmux/resolve error names none of this host's peers

Merged
TE
9d ago
+23-6

Follow-up to #26860. These are the two remaining findings from my Codex review of #26860, which #26860 landed without.

Leo's words, which the peer-state feed serves: "you can just not choose a project ... you just get a little green dot ... as if you were working on your own computer, but now it's remote."

Change

  • P1: _acpmux/resolve named this host's peers to a peer daemon. Its not-found error (hub/locate.rs unfound) listed every peer and each down peer's state, such as on <host> or its peers (gone); not connected now: gone (offline). #26860 empties peers only in successful replies, so this error still reached Origin::Peer connections, including paired client devices. server/requests.rs now passes names_hosts: false for Origin::Peer, which is the answer a read-only device already gets: no host or peer names. Nothing on a peer reads this error's text.
  • P3: the lag assertion now proves the snapshot. tests/peer_state_origin.rs asserted only heard.len() > 1, which the notes still in the feed satisfy even with no snapshot. Now peer y changes once, before a burst of 600 notes pushes its note out of the 256-slot feed. The unix-socket watcher must still get y, and only the snapshot carries it.

Test: fails before, passes after

The test now also checks that the _acpmux/resolve not-found error names gone on the unix socket and not to the peer.

  • Before (the same test with the old requests.rs), cmux-ci fast-checks 03fcb2639b0b:
    a peer's resolve named this host's peers: no session named, with the id or carrying the bead "no-such-session" on ip-172-31-73-130 or its peers (gone); not connected now: gone (offline)
    test result: FAILED. 0 passed; 1 failed
    
  • After, at head 4ab4b608, cmux-ci run https://github.com/manaflow-ai/cmux/actions/runs/40700431338:
    • fmt passed, and peer_state_origin passed 3 out of 3 runs.
    • Integration tests passed: peer_state_events 1, peer_origin 4, peer_status 4, peer_lease 8, web_token_exposure 6, peer_integration 50.
    • clippy -D warnings was clean.
    • --lib had one failure, the unrelated cli::codex_auth_broker flake, which also fails on base. On rerun, https://github.com/manaflow-ai/cmux/actions/runs/40701234744, --lib passed 1637 out of 1637 and codex_auth_broker passed 3 out of 3 runs.

Review

An independent Codex review (gpt-6-astra, high effort, fast mode) at 4ab4b608 returned VERDICT: SHIP. It also named two older peer-name disclosures that this PR does not change, as follow-ups:

  • an admission warning or suggestedHost can name another peer;
  • a peer_down_for error for a name/... session id carries that peer's state and connection error.

Takes back #25111: it does not undo it. #25111 added conn.auth != ConnAuth::ReadOnlyDevice to the _acpmux/resolve call; this PR extends that same condition with && conn.origin != Origin::Peer, so a read-only device keeps #25111's answer and a peer daemon now gets the same one.

Capture

No capture: no UI change. This touches the daemon's error text for peer connections only.

Risk

Low. The change only removes peer names from one error sent to Origin::Peer connections. The unix socket, the app and Web connections are unchanged.

Agent session: agent session

šŸ¤– Generated with Claude Code