Skip to content

[codex] Retry streamable HTTP initialize failures - #25147

Merged
ssetty-oai merged 21 commits into
mainfrom
dev/ssetty/retry-rmcp-initialize
Jun 9, 2026
Merged

[codex] Retry streamable HTTP initialize failures#25147
ssetty-oai merged 21 commits into
mainfrom
dev/ssetty/retry-rmcp-initialize

Conversation

@ssetty-oai

@ssetty-oai ssetty-oai commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Retry transient streamable HTTP failures during RMCP startup when the failure happens while sending the initialize request.
  • Retry transient streamable HTTP failures for tools/list, which is read-only and safe to replay.
  • Cover both retryable HTTP statuses and request-layer failures where no HTTP status is returned.
  • Surface retryable HTTP statuses from the streamable HTTP adapter as typed client errors.
  • Add integration coverage for initialize retry, tools/list retry, no-status request failure retry, and non-retryable initialize status.

Root cause

The observed codex_apps failures can happen before normal tool execution: RMCP startup fails while sending initialize, or the first read-only tools/list fails after startup. Retrying hosted_apps_bridge tools/call would not cover initialize and would risk replaying side-effecting tool calls. This change retries the streamable HTTP handshake itself, recreates the transport between initialize attempts, and retries only tools/list among post-initialize service operations.

Validation

  • cargo fmt --package codex-rmcp-client
  • cargo test -p codex-rmcp-client --test streamable_http_recovery

@ssetty-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@ssetty-oai
ssetty-oai marked this pull request as ready for review May 29, 2026 20:31
@ssetty-oai
ssetty-oai force-pushed the dev/ssetty/retry-rmcp-initialize branch from 0987537 to 71fe20b Compare May 29, 2026 20:35

@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: 098753766a

ℹ️ 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/rmcp-client/src/rmcp_client.rs Outdated
@ssetty-oai
ssetty-oai force-pushed the dev/ssetty/retry-rmcp-initialize branch from 71fe20b to 4d1e23e Compare May 29, 2026 21:02
@ssetty-oai
ssetty-oai marked this pull request as draft May 29, 2026 21:02
@ssetty-oai
ssetty-oai marked this pull request as ready for review May 29, 2026 21:04
@ssetty-oai
ssetty-oai force-pushed the dev/ssetty/retry-rmcp-initialize branch from 4d1e23e to f513db0 Compare May 29, 2026 21:20
@ssetty-oai
ssetty-oai marked this pull request as draft May 29, 2026 21:20
@ssetty-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@ssetty-oai
ssetty-oai marked this pull request as ready for review May 29, 2026 22:57
@ssetty-oai
ssetty-oai force-pushed the dev/ssetty/retry-rmcp-initialize branch from f513db0 to 9649a2e Compare May 29, 2026 23:01

@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: f513db0ac3

ℹ️ 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/rmcp-client/src/rmcp_client.rs Outdated
@ssetty-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 9649a2eaee

ℹ️ 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/rmcp-client/src/rmcp_client.rs Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

ssetty-oai added a commit that referenced this pull request Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: d00ea62d33

ℹ️ 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/rmcp-client/src/http_client_adapter.rs Outdated
Comment thread codex-rs/rmcp-client/src/rmcp_client.rs Outdated
Comment thread codex-rs/rmcp-client/src/rmcp_client.rs Outdated
Comment thread codex-rs/rmcp-client/src/rmcp_client.rs Outdated
Comment thread codex-rs/rmcp-client/tests/streamable_http_recovery.rs Outdated
Comment thread codex-rs/rmcp-client/Cargo.toml Outdated
ssetty-oai added a commit that referenced this pull request Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ 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".

ssetty-oai added a commit that referenced this pull request Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 00ee46ca9f

ℹ️ 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/rmcp-client/Cargo.toml Outdated
Comment thread sdk/python/pyproject.toml
Comment thread codex-rs/rmcp-client/src/rmcp_client_tests.rs Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

@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: a7ddbf9a88

ℹ️ 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/rmcp-client/src/http_client_adapter.rs Outdated
Comment thread codex-rs/rmcp-client/Cargo.toml Outdated
Comment thread sdk/python/src/openai_codex/api.py Outdated
Comment thread codex-rs/rmcp-client/src/rmcp_client.rs Outdated
ssetty-oai added a commit that referenced this pull request Jun 5, 2026
@ssetty-oai
ssetty-oai force-pushed the dev/ssetty/retry-rmcp-initialize branch from 9c604c6 to 1f6a75d Compare June 9, 2026 15:06

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 1f6a75d2ac

ℹ️ 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/rmcp-client/src/streamable_http_retry.rs
Comment thread codex-rs/rmcp-client/src/rmcp_client.rs

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 9dfb4be0ec

ℹ️ 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/rmcp-client/src/streamable_http_retry.rs
Comment thread codex-rs/rmcp-client/src/http_client_adapter.rs Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

@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: ce34025915

ℹ️ 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/rmcp-client/src/http_client_adapter.rs

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 7a381f591d

ℹ️ 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/rmcp-client/src/streamable_http_retry.rs
Comment thread codex-rs/rmcp-client/src/http_client_adapter.rs

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 4f29a9e89e

ℹ️ 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".

pub(super) const STREAMABLE_HTTP_RETRY_DELAYS_MS: [u64; 2] = [250, 1_000];

impl RmcpClient {
pub(super) async fn connect_pending_transport_with_initialize_retries(

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.

P2 Badge Split non-mechanical retry change into stages

This non-mechanical retry PR changes 1,024 lines across retry logic, adapter propagation, test support, and integration coverage, exceeding the repo’s review-size guidance; please split it into staged PRs. guidance

Useful? React with 👍 / 👎.

@ssetty-oai
ssetty-oai merged commit 490340f into main Jun 9, 2026
31 checks passed
@ssetty-oai
ssetty-oai deleted the dev/ssetty/retry-rmcp-initialize branch June 9, 2026 22:49
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 9, 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