{"record":{"id":"8c48b1589437d5c3","repo":"can1357/oh-my-pi","slug":"oauth-login-already-in-progress-for-pendingprovi","errorCode":null,"errorMessage":"OAuth login already in progress for ${pendingProvider}. Complete or cancel it before starting MCP OAuth.","messagePattern":"OAuth login already in progress for (.+?)\\. Complete or cancel it before starting MCP OAuth\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/modes/controllers/mcp-command-controller.ts","lineNumber":893,"sourceCode":"\t\t\tif (!oauthTimeout.signal.aborted) oauthTimeout.abort(reason);\n\t\t};\n\t\tconst flowClaim = await claimMCPOAuthFlow(manualInput, requestCancellation);\n\t\tconst originalOnEscape = this.ctx.editor.onEscape;\n\t\tthis.ctx.editor.onEscape = () => requestCancellation(MCP_OAUTH_USER_CANCEL_REASON);\n\t\tconst externalSignal = opts?.abortSignal;\n\t\tconst onExternalAbort = (): void => {\n\t\t\tconst reason = externalSignal?.reason;\n\t\t\trequestCancellation(typeof reason === \"string\" ? reason : MCP_OAUTH_USER_CANCEL_REASON);\n\t\t};\n\t\tif (externalSignal?.aborted) {\n\t\t\tonExternalAbort();\n\t\t} else {\n\t\t\texternalSignal?.addEventListener(\"abort\", onExternalAbort, { once: true });\n\t\t}\n\t\ttry {\n\t\t\tif (manualInput.hasPending()) {\n\t\t\t\tconst pendingProvider = manualInput.pendingProviderId ?? \"another provider\";\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`OAuth login already in progress for ${pendingProvider}. Complete or cancel it before starting MCP OAuth.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Create OAuth flow\n\t\t\tconst flow = new MCPOAuthFlow(\n\t\t\t\t{\n\t\t\t\t\tauthorizationUrl: authUrl,\n\t\t\t\t\ttokenUrl: tokenUrl,\n\t\t\t\t\tregistrationUrl: opts?.registrationUrl,\n\t\t\t\t\tissuerUrl: opts?.issuerUrl,\n\t\t\t\t\tclientId: resolvedClientId,\n\t\t\t\t\tclientSecret: resolvedClientSecret,\n\t\t\t\t\tscopes: scopes || undefined,\n\t\t\t\t\tprompt: opts?.prompt,\n\t\t\t\t\tredirectUri: opts?.redirectUri,\n\t\t\t\t\tcallbackPort: opts?.callbackPort,\n\t\t\t\t\tcallbackPath: opts?.callbackPath,\n\t\t\t\t\tresource: opts?.resource,","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/modes/controllers/mcp-command-controller.ts#L875-L911","documentation":"MCP OAuth setup refuses to start when the shared manual-input UI slot is already claimed by another OAuth flow. manualInput.hasPending() is checked at flow start; if a previous provider's manual code entry is still awaiting user input, this error names that provider and asks the user to finish or cancel it first.","triggerScenarios":"Starting a new MCP OAuth flow while a prior OAuth login (another provider) still holds the manual input prompt — e.g. the user began one provider's device-code flow, abandoned it, and immediately started a second flow.","commonSituations":"Switching between MCP servers and re-running the auth command before completing the first; a hung/abandoned OAuth prompt from a crashed or interrupted flow that never released its claim.","solutions":["Complete or cancel the in-progress OAuth login for the named provider before starting a new one","Press Esc / cancel the pending manual-code prompt, then re-run the MCP OAuth flow","Restart the session if the pending claim is orphaned and cannot be cancelled via UI"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check before starting the flow\nif (manualInput.hasPending()) {\n  console.log(`Finish or cancel OAuth for ${manualInput.pendingProviderId ?? 'another provider'} first.`);\n  return;\n}\nawait startMcpOAuth(...);","typeGuard":null,"tryCatchPattern":"try {\n  await startMcpOAuth(...);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('already in progress')) {\n    // surface which provider holds the slot and offer to cancel it\n  }\n}","preventionTips":["Serialize OAuth logins: one provider at a time","Cancel an in-progress login (Esc) before starting another","Detect orphaned claims and offer session restart"],"tags":["oauth","mcp","resource-conflict","ui-state"],"backgroundTag":"oauth-already-in-progress","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}