Session status card: acpmux fills Host, Auth source, Routing, Settings and Usage limits

Merged
TE
3d ago
+646-29

Leo, 2026-11-03: "how come the status doesn't say anything"

On a Claude chat the Session status card (/status, added in 11c3f51b9054 "feat(cmux-next): add shared harness status card", limits row from #27762) filled in Version, Session, CWD, Model, Effort and Context. Host, Auth source, Routing, Settings and Usage limits all said "Not reported".

Why

The card reads host, authSource, route/baseUrl and settingsSources from the session detail. acpmux never set them. For a claude-sr2 chat it also kept no spawn env at all, because claude_auth::remember ran only for family claude.

What changed

  • acpmux (session_status.rs, new): session detail now carries
    • host: this daemon's machine name. A peer's chat names the peer's own machine, since the detail comes from the remote daemon.
    • authSource: the sign-in Claude Code uses, picked in Claude Code's own precedence order: a cloud provider, then ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, apiKeyHelper, CLAUDE_CODE_OAUTH_TOKEN, a /login key, then the subscription login. It names the kind and where it came from (route, profile, environment, or a file path), never the value. A launcher (sr2 claude, sr claude proxy) is named as such.
    • route: the bound route's name, else the SR2 gateway, a subrouter, a custom endpoint, or "Direct (Anthropic)". It is never hidden for a direct login.
    • settingsSources: the settings files that exist (managed, the Claude home's settings.json, the project's .claude/settings*.json), plus "autocompact at 400K" when that window is set.
    • usageLimitsApply: false only when the sign-in has no plan limits (an API key, Bedrock or Vertex) and none were reported.
    • remember now runs for every Claude family. explain (the sign-in failure text) still applies to plain claude only, so claude-sr2 errors are unchanged. The route's name reaches the spawn through the internal ACPMUX_ROUTE_NAME key, which command.rs strips before the harness starts.
    • The file reads are cached per chat for 30 s, keyed on the spawn inputs, so attach and info reads do not re-read ~/.claude.json each time.
  • web: the card only renders these values. With no limit reported yet, the Usage limits row now reads "No limit reported yet" instead of "Not reported". It hides that row when acpmux says the row does not apply. New gallery variants claude-sr2 and claude-api-key show both.

Tests

  • tests/claude_auth_env.rs::session_info_names_host_sign_in_route_settings_and_limits: a fake Claude launched with a profile that sets CLAUDE_CONFIG_DIR, ANTHROPIC_AUTH_TOKEN and an SR2 gateway URL. _acpmux/info carries host, "Auth token (ANTHROPIC_AUTH_TOKEN, from its profile)", "SR2 gateway (…)", both settings files plus autocompact, and the reported limits. The token value appears nowhere.
  • session_status_tests.rs: auth precedence and labels, route labels, launcher detection, settings files, plan-limit applicability.
  • HarnessStatusCard.dom.test.tsx: the card shows the daemon's rows, says "No limit reported yet", hides Usage limits when it does not apply, and still shows limits that were reported.

Observed / Not run

  • Ran locally: bun test src/agent-session/acpmux/HarnessStatusCard (19 pass) and scripts/web-lint.sh (pass).
  • Rust: run through cmux-ci at the head (results in a comment). No DEV build check yet.

risk: normal. No capture: the gallery variants agent-pane.harness-status/claude-sr2 and /claude-api-key render the new states.

Changelog

  • Fixed: the Session status card now shows the machine, sign-in source, routing, settings files and usage-limit state for Claude chats instead of "Not reported".

Agent session: agent session

🤖 Generated with Claude Code


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


Summary by cubic

The Session status card now shows the machine, sign-in source, routing, settings files, and usage-limit state for Claude chats instead of "Not reported".

  • acpmux fills these from the spawn env it now remembers for every Claude family, the bound route's name, the launcher argv (sr2 claude, sr claude proxy), and the settings files in force.
  • The sign-in is named by kind and origin (route, profile, environment, or file path), never a credential's value; the machine goes in a new machine field so the web does not treat a local chat as remote.
  • The Usage limits row reads "No limit reported yet" until one is reported, and hides entirely when the sign-in has no plan limits (API key, Bedrock/Vertex).
  • File reads are cached per chat for 30 seconds and run off the async workers.

Tests

  • A fake Claude launched from a profile sets CLAUDE_CONFIG_DIR, ANTHROPIC_AUTH_TOKEN and an SR2 gateway URL; _acpmux/info carries the machine, sign-in kind and origin (never the token value), route, settings files plus autocompact, and the reported limits.
  • Rust unit tests cover auth precedence and labels, route labels, launcher detection, settings files, and plan-limit applicability.
  • HarnessStatusCard.dom.test.tsx covers the new rows, "No limit reported yet", the hidden Usage limits row, and limits that were reported.