Repository navigation
acpmux: session/auth reads the route probe and answers a target - #26700
Conversation
|
Bead |
|
Found 4 test failures on Blacksmith runners: Failures
|
1a5294b to
3e5c12e
Compare
3e5c12e to
626c4cf
Compare
cacdd34 to
fd2ce0f
Compare
fcc5883 to
549778a
Compare
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Passes: CI passes on CI passes on Written by web and size checks: green |
A chat's bound route's probe (at most 5 min old, or a fresh one with refresh, never a keychain
route's; rate_limited and unknown fall through) comes before its turn, and a target
{harness, routeId?} with no host reads the newest turn of a chat here with the same harness,
route and account home (fromSessionId). Asking a peer and listing the feature come next.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
549778a to
2a139fc
Compare
|
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40693729434 at 3df9106 failed: cmux-next checks (god files, concurrency, crash safety, l10n). |
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Leo: “you gotta re-authenticate. You gotta log in again on the modal picker before the user even sends a prompt.”
This is the third of four PRs for
_acpmux/session/auth. It builds on #26699, which has merged. It adds two things: the bound route's probe as evidence, and the target form for a chat that hasn't started. The fourth PR, #26845 (stacked on this one), asks peers and lists thesessionAuthfeature, soinitializedoesn't list it yet. Together with the next PR, this was one PR. That PR got a SHIP from the reviewer and was split here to stay under 800 lines.Evidence, in order:
target.host) is invalid params ("not answered yet"). The next PR asks the peer.routes::spawn_route, from acpmux: _acpmux/session/auth answers a chat's sign-in from its own turns #26699).route_probe::probes_for).local-coderouter, orcmux-routerwith no secret) mints a key per family, so its probe speaks only for the exact family it probed as.refresh, a fresh probe runs. Otherwise the last answer is used if it is no more than 5 minutes old and came from the route as it is now.route_probe.rskeeps each route's last answer with the route file it probed. Every read and every probe drops answers older than 5 minutes, and the oldest once more than 64 routes are kept.keychain:reference.auth_neededgives routeAuthNeeded, withlogin {kind: "route", routeId}.unreachablegives routeUnreachable.rate_limitedandunknownfall through and are never treated as a sign-in state.target {harness, routeId?}uses the newest turn of any chat on this daemon with the same harness, the same route and the same account home, and setsfromSessionIdto that chat. Another account home never leaks in.defaultsenv under the profile's env (Hub::spawn_profile). A home those pin beats a family or global route's home, but not the home of a route picked for the chat or the profile.routeIdmeans the default route, as at spawn.routeIdthat is gone, or that doesn't serve the harness, is invalid params, as a spawn would refuse it. A sibling chat whose own route a spawn would refuse is skipped.refresh, the harness's own check that reads no keychain, as in acpmux: _acpmux/session/auth answers a chat's sign-in from its own turns #26699, run over the defaults' env.Tests. After is this head, on cmux-ci run 40669532019: fmt and clippy
-D warningsare clean; acpmux lib (1630), session_auth (7), hub_integration (514;prompt_supersede::a_prompt_queued_before_a_restart_is_still_replacedis flaky, see below), the route suites, typed_errors, harness_health, claude_auth_env and no_keychain pass.Before, each new test failed on the tree without its fix:
session_auth_for_a_target_reads_only_its_own_account: a target with no chats gives unknown. A chat in another account home that is signed out doesn't leak into the target. A sibling's signedOut is picked up, withfromSessionId. An unknown harness is invalid params.session_auth_reads_the_routes_probe_and_a_rate_limit_falls_through(local HTTP 401, 429 and 200 endpoints):session_auth_reads_the_home_the_defaults_pin, where a home thedefaultsenv pins is named for both a chat and a target.route_probe::tests::a_probe_speaks_for_the_family_whose_endpoint_it_tests, for relay routes and for OpenCode and Pi.route_probe::tests::{kept_answers_are_recent_and_bounded, a_kept_answer_is_for_the_route_as_probed}hub::session_auth::tests::{a_rate_limited_probe_falls_through, a_target_keeps_the_home_its_profile_pins, a_route_is_taken_as_a_spawn_takes_it}Risk: medium-low. Everything is read-only. A fresh probe runs only with
refresh, never on a keychain route, and never for a Web connection.No capture: no UI changes; this is a daemon method no view calls yet.
Agent session: agent session
🤖 Generated with Claude Code