Expand description
Pre-launch OAuth flow RPC handlers.
Four commands per docs/specs/SPEC_PRE_LAUNCH_OAUTH_FLOW_2026_05_14.md §7
(request types named after that section’s RPCs), plus
identity.ensureaccountdir:
auth.start—StartProviderAuthReqauth.poll—PollProviderAuthReqauth.submitcallback—SubmitAuthCallbackReqauth.cancel—CancelProviderAuthReq
The spec’s fifth, auth.submitapikey, was removed: it was never built, and
API-key accounts are added through account.key.verify and
upsertidentityaccount instead.
This module owns the RPC surface and dispatches into
crate::identity::auth_session::AuthSessionManager. auth.start also
spawns the provider CLI (spawn_auth_cli), which feeds stdout lines
into the session via record_line.
Split across four files (module-organization pass, see
docs/specs/PLAN_LOGIN_SINGLE_PATH_CONSOLIDATION_2026_07_20.md):
this file owns the RPC surface (wire types + register_identity_handlers);
identity_auth_spawn owns the subprocess spawn/drain engine
(spawn_auth_cli, spawn_auth_cli_pty, confirm_authenticated);
identity_auth_dirs owns filesystem/directory provisioning
(compute_and_ensure_bundle_dir, compute_and_ensure_account_dir);
identity_auth_persist owns IdentityAccount persistence on OAuth
success (persist_oauth_direct_account, persist_oauth_success).
Structs§
- AckResp
- Cancel
Provider Auth Req - Ensure
Account DirReq - Ensure
Account DirResp - Poll
Provider Auth Req - Start
Provider Auth Req - Submit
Auth Callback Req
Constants§
- COMMAND_
AUTH_ CANCEL - COMMAND_
AUTH_ POLL - COMMAND_
AUTH_ START - COMMAND_
AUTH_ SUBMIT_ CALLBACK - COMMAND_
ENSURE_ ACCOUNT_ DIR - Mints (or reuses) a per-account isolated config dir without spawning any
CLI — a standalone entry point onto
compute_and_ensure_account_dirfor callers that need the dir BEFORE a credential exists in it — today the terminal-login tier, which must know where to point the login before it opens a terminal. (It previously also servedseed_provider_auth_from_global, the copy-from-personal-~/.claudepath removed 2026-08-31.) Seedocs/specs/PLAN_LOGIN_SINGLE_PATH_CONSOLIDATION_2026_07_20.md§7 — “single point, not global”: every credential-bearing dir a running agent reads from must belong to a realIdentityAccountrow, never the shared default dir.