Skip to content

Persist Responses API IDs in rollouts#13681

Closed
charley-oai wants to merge 12 commits intomainfrom
charley/log-rollout-response-ids
Closed

Persist Responses API IDs in rollouts#13681
charley-oai wants to merge 12 commits intomainfrom
charley/log-rollout-response-ids

Conversation

@charley-oai
Copy link
Collaborator

Summary

  • persist Responses API request IDs into rollout metadata as soon as response headers arrive
  • persist response IDs from response.created and write request IDs even when the request fails before streaming
  • serialize absent metadata fields as explicit null values and add rollout coverage for success and error cases

Testing

  • cargo test -p codex-api
  • cargo test -p codex-otel
  • cargo test -p codex-core rollout_persists_ -- --nocapture
  • cargo test -p codex-app-server --no-run

Notes

  • did not run the full cargo test suite because the repo instructions say to ask first after core or protocol changes

Write request IDs as soon as headers arrive, including error paths, and persist explicit null fields in rollout response metadata.

Add rollout coverage for both successful and error responses.

Co-authored-by: Codex <noreply@openai.com>
@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
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: bb05429f8d

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

charley-oai and others added 3 commits March 5, 2026 21:43
Handle the new rollout response metadata event in exhaustive matches outside core so downstream crates keep compiling.

Co-authored-by: Codex <noreply@openai.com>
Do not reuse the websocket upgrade request ID as per-turn rollout metadata for later stream requests.

Co-authored-by: Codex <noreply@openai.com>
Update resume expectations for replayed response metadata and regenerate app-server protocol schema fixtures.

Co-authored-by: Codex <noreply@openai.com>
@charley-oai
Copy link
Collaborator Author

@codex review this

1 similar comment
@charley-oai
Copy link
Collaborator Author

@codex review this

Mark response metadata as internal-only for schema export and strip it from app-server notifications while keeping rollout persistence intact.

Co-authored-by: Codex <noreply@openai.com>
Copy link
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: 1e080a5871

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

charley-oai and others added 6 commits March 6, 2026 01:04
Filter rollout-only response metadata out of resumed initial messages in protocol, so app-server does not need to scrub SessionConfigured history.

Keep app-server's live event suppression so ResponseMetadata stays out of the public interface.

Co-authored-by: Codex <noreply@openai.com>
Rename the response stream field that carries an early request ID for rollout persistence so its purpose is explicit.

Co-authored-by: Codex <noreply@openai.com>
Rename the response stream field to request_id_for_rollout_log so its purpose is explicit at the call sites.

Co-authored-by: Codex <noreply@openai.com>
Keep the cloned event binding named event when filtering response metadata from app-server notifications.

Co-authored-by: Codex <noreply@openai.com>
Use rollout ResponseMetadata terminology in the websocket request-id comment to avoid confusion with the static rollout metadata header.

Co-authored-by: Codex <noreply@openai.com>
Carry optional request IDs on core invalid-request errors so pre-stream HTTP 400 failures still emit rollout response metadata.

Co-authored-by: Codex <noreply@openai.com>
@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

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

Replace the rollout-only response metadata event with separate ResponsesApiRequestId and ResponsesApiResponseId events so persisted logs do not carry unrelated null fields.

Co-authored-by: Codex <noreply@openai.com>
@charley-oai charley-oai closed this Mar 7, 2026
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