fix(auth): `auth logout` removes the saved Altimate gateway key
Problem
altimate-code auth logout → "altimate-backend" removed only the auth.json entry. Browser sign-in also saves the gateway key to ~/.altimate/altimate.json, and the provider loader and all workspace calls (api-client, state, identity, memory/skill sync, link, datamate) read that file first. After sign-out the key stayed on disk and still worked, so delegated runs (e.g. /altimate-code:altimate from Claude Code) kept sending requests as the signed-out user. On a shared machine, the next person's runs go out under the previous user's identity.
Fix
providers.ts: logging out ofaltimate-backendnow callsAltimateApi.clearCredentials()(viacliTry, so a failed delete is reported rather than "Logout successful").providers.ts: the logout picker listsaltimate-backendwhen onlyaltimate.jsonexists (credentials pasted in the TUI dialog). Before, the CLI reported "No credentials found" and gave no way to sign out.provider-credentials.tsx: TUI/logoutalso removes theauth.jsonentry. A pastedurl::instance::keythere would otherwise keep the provider loader's fallback path working.
After sign-out, workspace calls hit NotConfiguredError ("Altimate credentials not configured — sign in first.").
Not in scope
The key is only removed locally; it is not revoked on the server. Revoking it at sign-out needs a backend endpoint.
Testing
- New CLI test in
test/cli/providers-logout.test.tscovers browser sign-in (both stores) and file-only credentials. It fails onmain(altimate.jsonstill present) and passes with this change. bun test test/cli test/upstream/fork-feature-guards.test.ts: 1187 pass. 4 failures intest/cli/run/{json-output,budget-finalization}.test.tsalso fail onmainand are unrelated.
🤖 Generated with Claude Code
Summary by CodeRabbit
- Bug Fixes
- Logging out of the Altimate backend now removes its saved credentials, whether they’re stored in Altimate’s settings or the shared authentication store.
- Logout works consistently from the command line and the interface, while leaving credentials for other providers unchanged.
- Documentation
- Added instructions for signing out of the Altimate LLM Gateway using the command line or the interface.