Skip to content

[codex] Retry streamable HTTP initialize failures#25147

Open
ssetty-oai wants to merge 16 commits into
mainfrom
dev/ssetty/retry-rmcp-initialize
Open

[codex] Retry streamable HTTP initialize failures#25147
ssetty-oai wants to merge 16 commits into
mainfrom
dev/ssetty/retry-rmcp-initialize

Conversation

@ssetty-oai
Copy link
Copy Markdown

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

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
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
Copy link
Copy Markdown
Contributor

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

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
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
Copy link
Copy Markdown
Contributor

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

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
Author

@codex review

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown
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".

Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown
Contributor

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

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
Author

@codex review

Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown
Contributor

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

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: 5540ca946a

ℹ️ 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 codex-rs/rmcp-client/src/rmcp_client.rs Outdated
Comment thread codex-rs/rmcp-client/src/rmcp_client.rs Outdated
Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown
Contributor

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

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: 78265d6f10

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

@codex review

Copy link
Copy Markdown
Contributor

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

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: 2dd78920b0

ℹ️ 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 Outdated
@ssetty-oai
Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Swish!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant