Skip to content

Desktop chat: cold-start initializeAcp() still awaits OAuth in-band (same stall as .113, at bridge init) #10407

Closed

Description

@Git-on-my-level

Problem

The .113 chat-freeze fix (ACP -32000 under piMono → terminalize-first) severed the in-band OAuth await on the active-turn recovery paths (onRecoverableError / recoverAfterError now signal Swift and return false). But the cold-start bridge-init path still awaits OAuth in-band, so the same 60s-silence → 2-minute-OAuth-timeout stall survives when ACP requires auth at initialization instead of mid-turn.

Evidence

desktop/macos/agent/src/index.ts:1029-1052 — initializeAcp() catches AcpError code -32000 and does:

logErr(`ACP requires authentication: ${JSON.stringify(authMethods)}`);
await startAuthFlow();      // blocks up to 2 min; Swift startClaudeAuth() is a silent no-op under piMono
await initializeAcp();      // retry after auth

startAuthFlow() (index.ts:951) awaits the OAuth callback (2-minute timeout). Under piMono preference, Swift's startClaudeAuth() is gated on isUserClaudeMode and never opens the browser, so the callback never arrives — identical to the incident, just triggered at bridge init (first send after launch, or the restart path at index.ts:1550) rather than on an admitted turn. The active-turn fix does not cover this call site; it was consciously deferred in the incident synthesis (Cold-start initializeAcp() OAuth policy, .coordination/chat-freeze-113/committee-synthesis.md §7 "Do not do in this PR").

Suggested scope (one self-contained PR)

Apply the same terminalize-first contract to init: on -32000 during initializeAcp(), signal auth_required to Swift and surface a terminal provider-auth state instead of await startAuthFlow(). The first user send then fails fast with failureCode: authentication rather than hanging. Falsifiable test (mirrors the existing acp-auth-terminal.test.ts T1): cold-start ACP init injects -32000 with no OAuth callback → init returns without blocking (<1s), no startAuthFlow await, subsequent send terminalizes as authentication.

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Jul 24, 2026
  2. added a commit that references this issue on Jul 29, 2026
    0be628a
  3. moved this from In progress to In review in omi TODO / bountieson Jul 29, 2026
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions