different-ai/openwork · error
Authorization for ${input.connectionName} did not finish. Co
Error message
Authorization for ${input.connectionName} did not finish. Complete it in the browser, then try reconnecting again. What it means
After polling for timeoutMs without finding a connection whose authorization is fresher than previousConnectedAt, waitForFreshMcpAuthorization gives up and throws this message naming the connection. It means the browser OAuth callback either never completed or the refreshed authorization never appeared in listConnections results before the deadline.
Source
Thrown at apps/app/src/react-app/domains/session/surface/mcp-chat-reconnect.ts:67
if (!input.isScopeCurrent()) {
throw new Error("The active OpenWork Cloud account changed while reconnecting. Try again in this workspace.")
}
try {
const connections = await input.listConnections()
if (!input.isScopeCurrent()) {
throw new Error("The active OpenWork Cloud account changed while reconnecting. Try again in this workspace.")
}
const connection = connections.find((entry) => entry.id === input.connectionId)
if (connection && hasFreshMcpAuthorization(connection, input.previousConnectedAt)) return connection
} catch (error) {
if (error instanceof Error && error.message.startsWith("The active OpenWork Cloud account changed")) throw error
// A transient list failure should not turn a successful browser callback
// into a false failure. Keep polling until the bounded timeout.
}
await sleep(intervalMs)
}
throw new Error(`Authorization for ${input.connectionName} did not finish. Complete it in the browser, then try reconnecting again.`)
}
View on GitHub (pinned to 2b7df46e8a)
Solutions
- Complete the authorization in the browser and click Reconnect again, as the message instructs.
- Allow popups for the app origin so the OAuth window can open, then retry.
- Increase timeoutMs / reduce intervalMs if your IdP login reliably takes longer than the current window.
- Verify the server actually bumps the connection's connected/updated timestamp on re-auth; if not, hasFreshMcpAuthorization will never pass.
Example fix
// before
const connection = await waitForFreshMcpAuthorization({ timeoutMs: 30_000, ... });
// after
const connection = await waitForFreshMcpAuthorization({ timeoutMs: 120_000, intervalMs: 1_000, ... }); Defensive patterns
Strategy: retry
Validate before calling
// Verify the callback can complete before starting the wait
if (!popupAllowedFor(appOrigin)) {
showToast("Allow popups to complete authorization");
return;
}
await waitForFreshMcpAuthorization(input); Type guard
function isAuthTimeoutError(e: unknown, connectionName: string): e is Error {
return e instanceof Error && e.message.startsWith(`Authorization for ${connectionName} did not finish`);
} Try / catch
try {
await waitForFreshMcpAuthorization({ ...input, timeoutMs: 120_000, intervalMs: 1_000 });
} catch (e) {
if (isAuthTimeoutError(e, input.connectionName)) {
showToast("Finish the browser authorization, then retry");
return;
}
throw e;
} Prevention
- Allow popups for the app origin so the OAuth window can open and complete.
- Size timeoutMs generously for your IdP's login latency (manual logins can exceed 30s).
- Confirm the server bumps the connection's connected/updated timestamp on re-auth, or hasFreshMcpAuthorization will never succeed.
- Show the pending-auth state in the UI so users know to finish the browser step.
When it happens
Trigger: The user abandons or blocks the browser authorization, the OAuth redirect/callback never reaches the app, listConnections keeps failing transiently for the whole window, or the connection returns but with an updatedAt/connectedAt older than previousConnectedAt (authorization not actually refreshed).
Common situations: Popup blocked by the browser, user closes the auth tab, slow IdP login exceeding the timeout, clock skew making the fresh check fail, or a server that doesn't update the connection timestamp.
Related errors
- OpenWork-managed MCP OAuth is currently available for local
- OpenWork-managed OAuth requires a remote MCP URL.
- MCP_OAUTH_CONFIGURATION_REQUIRED
- MCP_OAUTH_ISSUER_MISMATCH
- MCP_LIFECYCLE_DEADLINE
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/23d57926c2287deb.
Report an issue: GitHub.