Skip to content

Agent: add maple-agent logout and refuse login while signed in - #1620

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-logout-maple
Nov 16, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-logout-maple

Conversation

@w3irdrobot

@w3irdrobot w3irdrobot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

maple-agent login said "signing in again replaces it", read the email and password, and then failed with "Maple is already signed in. Sign out before changing accounts." There was no command-line way to sign out, so a headless remote host could not sign in again, for example after a password change.

The refusal is intentional. Since #1161 the shared host only signs in from a signed-out state, so an account change always goes through an explicit sign-out that revokes ACP connections and old account handles. The CLI message predates that change; the #1161 review flagged it and it was never fixed. This PR keeps the host rule:

  • maple-agent login checks for a saved sign-in before prompting and stops with: "Maple is already signed in. Run maple-agent logout first, then sign in again."
  • New maple-agent logout calls the host's logout_and_clear, the same operation behind the desktop's Sign out. It drains the account's runtime, reports the sign-out and removes the saved session. With no saved sign-in it says so and exits 0. Like login, it needs an unlocked store.

Sign-out shuts down remote access, and it comes back when the same account signs in again if it was enabled (host.rs, the account-change handling after each request). Pairings, tasks and settings are account-scoped and are not removed. The README documents both commands. No host, protocol or store changes.

Testing

  • Pre-commit on 25421914 and 9a7d870f: ci-lint (fmt, clippy for every feature set) and ci-test (all workspace tests) passed. One earlier hook run on 9a7d870f failed ui::chat::tests::state_tests::test_removing_project_cancels_catalog_wait_and_opens_empty_fallback, a timed UI wait unrelated to this change; it passed 8/8 alone and in the rerun.
  • New parse test: logout takes no arguments.
  • Not exercised: logout, or login while signed in, against a live host with a real or Local fixture account.

🤖 Generated with Claude Code


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

The shared host only signs in from a signed-out state, but
`maple-agent login` still claimed it would replace a saved sign-in, then
failed after the password prompt. There was no command-line way to sign
out, so a headless host could not sign in again (for example after a
password change).

`login` now stops before prompting and points to `maple-agent logout`.
`logout` runs the desktop's Sign out sequence through the host
(`stop_runtime`, then `logout_and_clear`). Account-scoped data and remote
pairings stay for the next sign-in to the same account.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AnthonyRonning
AnthonyRonning merged commit 8b484e5 into master Nov 16, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-logout-maple branch November 16, 2026 21:58
@w3irdrobot
w3irdrobot restored the codex-logout-maple branch November 16, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants