Skip to content

Avoid blocking thread startup on MCP OAuth discovery - #32825

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/56fe0188cc1ceaf746b0b65e8b7dd1fd2e13420d
Jul 13, 2026
Merged

Avoid blocking thread startup on MCP OAuth discovery#32825
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/56fe0188cc1ceaf746b0b65e8b7dd1fd2e13420d

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 13, 2026

Copy link
Copy Markdown

Avoid blocking thread startup on MCP OAuth discovery

Why

OAuth metadata discovery for an optional HTTP MCP server can stall, delaying
thread/start even though that server is not required.

What changed

  • Remove eager MCP authentication-status discovery from session and connection
    manager startup.
  • When an MCP connection reports an authentication error, inspect configured and
    stored credentials locally to preserve login and reauthentication failure
    reasons without making another discovery request.
  • Continue using server configuration directly for startup error messages and
    timeout hints.

Testing

Add an app-server regression test with an optional HTTP MCP endpoint that accepts
a connection but never responds, and verify that thread/start completes without
waiting for its configured startup timeout.

## Why

OAuth metadata discovery for an optional HTTP MCP server can stall, delaying
`thread/start` even though that server is not required.

## What changed

- Remove eager MCP authentication-status discovery from session and connection
  manager startup.
- When an MCP connection reports an authentication error, inspect configured and
  stored credentials locally to preserve login and reauthentication failure
  reasons without making another discovery request.
- Continue using server configuration directly for startup error messages and
  timeout hints.

## Testing

Add an app-server regression test with an optional HTTP MCP endpoint that accepts
a connection but never responds, and verify that `thread/start` completes without
waiting for its configured startup timeout.

GitOrigin-RevId: 56fe0188cc1ceaf746b0b65e8b7dd1fd2e13420d
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/56fe0188cc1ceaf746b0b65e8b7dd1fd2e13420d branch from 8c800bf to 2e156cb Compare July 13, 2026 15:48
@copyberry
copyberry Bot merged commit 2e156cb into main Jul 13, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/56fe0188cc1ceaf746b0b65e8b7dd1fd2e13420d branch July 13, 2026 15:49
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants