Skip to content

Runtime.logout: sign a runtime out through its own logout, next to login/authStatus #192

Closed

Description

@xxchan

Ask

A Runtime.logout(installation) next to login and authStatus (oar 0.22), so a host can sign a runtime out the same way it signs it in. Ferry's owner asked for "sign out" next to Ferry's "Sign in" on a machine's page (D071 deferred it).

Native commands (from each CLI's own help on this machine; not run)

  • claude: claude auth logout ("Log out from your Anthropic account").
  • codex: codex logout ("Remove stored authentication credentials").
  • grok: logout ("Sign out and clear cached credentials").
  • kimi: has login (device-code flow); logout to check.
  • cursor: SDK Cursor.auth has login/status; whether it has a logout, or whether removing the SDK's stored login is the way, to check.
  • pi: ModelRuntime.logout(providerId) already exists behind createPiProviderAuth.
  • opencode, antigravity: to check.

Possible contract (yours to decide)

  • logout(installation, options?) → { kind: "logged_out" } | { kind: "failed", reason, detail? } | { kind: "unsupported", reason }, absent on runtimes without a native logout (capabilities as types).
  • What it removes is the runtime's own stored sign-in for that installation, through its own command, never by deleting files behind its back. An API key in the environment (e.g. CURSOR_API_KEY) isn't touched; authStatus afterwards tells the truth either way.
  • Evidence like feat(runtimes): sign claude and codex in through their own login #94: a real-login checklist per runtime (log in, log out, status reads logged out; logging out when already out).

Activity

  1. xxchan commented on Oct 7, 2026

    @xxchan
    MemberAuthor

    Shape decided by @cindy (Raft #proj-ferry thread 221c8412, msg e2d5c115):

    // Runtime, optional member: absent on runtimes without a native logout
    logout?(installation: AvailableInstallation, options?: { timeoutMs?: number }): Promise<LogoutResult>;
    
    type LogoutResult =
      | { kind: "logged_out" }
      | { kind: "failed"; reason: LogoutFailureReason; detail?: string }
      | { kind: "unsupported"; reason: LoginUnsupportedReason; detail?: string };

    Rules

    • Only the runtime's own logout: claude claude auth logout, codex codex logout, cursor SDK Cursor.auth.logout (mentioned in SDK 1.0.36 stored-credentials.d.ts; check its signature). Never delete its credential files directly.
    • Confirm with authStatus afterwards, as login does: logged_out only when it reads logged out. Native command succeeded but status still reads logged in (credentials from the environment or another source) → failed with reason still_logged_in, detail saying what it read; never report logged out. Environment variables like CURSOR_API_KEY, ANTHROPIC_API_KEY are not touched.
    • Logging out when already logged out: report whatever the native command answers, but authStatus decides; the result is logged_out.
    • failed reasons reuse login's where they fit (process_failed, timed_out, rejected), adding only still_logged_in; unsupported only for installation/version. Details are redacted the same way.
    • Whether the server side revokes the credential: document each runtime's actual behaviour on its page; cursor's minted key stays valid in the dashboard and the SDK can't revoke it — say so clearly.
    • Scope: the three runtimes oar already signs in (claude, codex, cursor). pi's logout stays in createPiProviderAuth, not Runtime.logout. grok and others with a native logout wait until oar does their login.
    • CLI: oar logout <runtime>, exit codes like login.

    Evidence: a real-machine checklist like #94, on cindytest (nobody's own machine): log in, log out, authStatus reads logged out, log out again when already out, still_logged_in with credentials in the environment. The login step needs a real account (xxchan, when it's time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions