Expand description
IdentityAccount persistence on a successful OAuth handshake.
Split out of identity_handlers.rs (module-organization pass, see
docs/specs/PLAN_LOGIN_SINGLE_PATH_CONSOLIDATION_2026_07_20.md) —
called from identity_auth_spawn’s drain/post-exit success paths
(spawn_auth_cli + spawn_auth_cli_pty, two call sites each).
Functions§
- persist_
oauth_ 🔒direct_ account - Upserts the
IdentityAccount(SecretRef::OAuthConfigDir, status “valid”) on a successful OAuth handshake (CLI exited 0 + authCheckCommand confirmed). The actualagent_identity_linkwrite happens later, once the agent exists (the launch-flow write-through reconcile) — this function only makes sure the account itself exists and is ready to be linked. - persist_
oauth_ 🔒success - Shared by all 4 OAuth-success call sites (pipes drain/post-exit, PTY
drain/post-exit) — persists the account and builds the
(bundle_id, account_id)pairAuthSessionManager::finish_successexpects.bundle_idis always empty now: bundle mode (db_identity_bundlesbinding) was retired in Phase 4c of SPEC_PRESET_TO_BUNDLE_REFACTOR_2026_07_02.md — confirmed unreachable from the frontend (AuthFlowControllerhardcodesdirectAccount: true)._direct_account/_into_bundle_idstay as parameters so the wire request shape and the 4 call sites don’t need touching.diris the account’s own isolation dir, resolved once at spawn time bycompute_and_ensure_*_dirin theauth.starthandler.