Skip to content

[codex] Make MCP connection startup fallible - #27261

Merged
aibrahim-oai merged 19 commits into
mainfrom
codex/fallible-mcp-connection-startup
Jun 10, 2026
Merged

aibrahim-oai merged 19 commits into
mainfrom
codex/fallible-mcp-connection-startup

Conversation

@aibrahim-oai

@aibrahim-oai aibrahim-oai commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

Required MCP server startup was enforced in Session::new after McpConnectionManager had already created the clients. That split let other manager construction paths bypass the same requirement and exposed manager internals solely so the session could validate them. Keeping required-server readiness in the constructor gives every caller one consistent startup contract.

What changed

  • make McpConnectionManager::new return anyhow::Result<Self> and fail when an enabled, required server cannot initialize
  • pass the startup cancellation token into the constructor so required-server waits remain cancellable
  • propagate constructor failures through resource reads, connector discovery, and MCP status collection
  • preserve the active manager and cancellation token when a refreshed replacement fails
  • keep required-startup failure collection private and cover the constructor error contract directly

Validation

  • updated the focused connection-manager test to assert the complete required-server startup error
  • local tests not run; relying on CI

@aibrahim-oai
aibrahim-oai requested a review from a team as a code owner June 9, 2026 23:06
@aibrahim-oai

aibrahim-oai commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

@aibrahim-oai aibrahim-oai changed the title Make MCP connection startup fallible [codex] Make MCP connection startup fallible Jun 9, 2026
Base automatically changed from codex/tighten-mcp-connection-manager-api to main June 9, 2026 23:07
@aibrahim-oai
aibrahim-oai force-pushed the codex/fallible-mcp-connection-startup branch from c258211 to c504b32 Compare June 9, 2026 23:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2582110de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/codex-mcp/src/mcp/mod.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41dda768e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server/src/request_processors/mcp_processor.rs Outdated
Comment thread codex-rs/codex-mcp/src/mcp/mod.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6385c6b3b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/session/mcp.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc2754bbba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/session/session.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a48cb410f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/codex-mcp/src/connection_manager_tests.rs Outdated
@aibrahim-oai
aibrahim-oai merged commit a7b6bae into main Jun 10, 2026
31 checks passed
@aibrahim-oai
aibrahim-oai deleted the codex/fallible-mcp-connection-startup branch June 10, 2026 07:18
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 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.

2 participants