Skip to content

[codex] Add configurable reasoning summary delivery#30752

Open
alexi-openai wants to merge 5 commits into
mainfrom
codex/reasoning-summary-delivery
Open

[codex] Add configurable reasoning summary delivery#30752
alexi-openai wants to merge 5 commits into
mainfrom
codex/reasoning-summary-delivery

Conversation

@alexi-openai

Copy link
Copy Markdown
Contributor

Summary

  • add a reasoning_summary_delivery config option with sequential, concurrent, and concurrent_cutoff values
  • send stream_options.reasoning_summary_delivery on OpenAI Responses API requests over HTTP and WebSocket
  • omit the internal stream option for custom providers
  • expose the setting through app-server config schemas and persist it in config lockfiles

Why

The Responses API can deliver reasoning summaries concurrently with later response items, but clients must explicitly request the delivery mode. This gives the CLI and app-server config path a typed way to opt in while preserving existing behavior by default.

Validation

  • focused codex-core HTTP, WebSocket, non-OpenAI omission, and config-lock tests
  • codex-api test suite: 130 passed
  • codex-config test suite: 201 passed
  • codex-app-server-protocol test suite and schema fixtures: 251 passed
  • scoped Clippy autofix, formatting, and diff checks
@alexi-openai alexi-openai marked this pull request as ready for review June 30, 2026 20:35
@alexi-openai alexi-openai requested a review from a team as a code owner June 30, 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: ded89cfb27

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

"invalid reasoning_summary_delivery override: {error}"
))
})?;
existing_thread.set_reasoning_summary_delivery(reasoning_summary_delivery);

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 Validate resume before mutating delivery

When a client resumes a running thread with both reasoning_summary_delivery and a stale path, this mutates the existing thread before the path consistency check below returns invalid_request. The failed resume can still change stream options for later turns observed by other clients; defer the setter until after the path and resume-mismatch validation succeeds.

AGENTS.md reference: AGENTS.md:L102-L110

Useful? React with 👍 / 👎.

pub model_reasoning_effort: Option<ReasoningEffort>,
pub plan_mode_reasoning_effort: Option<ReasoningEffort>,
pub model_reasoning_summary: Option<ReasoningSummary>,
pub reasoning_summary_delivery: Option<ReasoningSummaryDelivery>,

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 Forward reasoning delivery through TUI thread params

When this config is set in a local TUI session connected to a remote app server, the value is parsed into Config here, but config_request_overrides_from_config in tui/src/app_server_session.rs is the path that serializes local Config into thread/start, thread/resume, and thread/fork overrides and it still omits reasoning_summary_delivery. The remote app server therefore never sees the new knob, so include it in that overrides map and its coverage.

AGENTS.md reference: AGENTS.md:L102-L110

Useful? React with 👍 / 👎.

@dylan-hurd-oai dylan-hurd-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This generally makes sense, but I'd like to better understand why we have to have the mutex specifically for this new field

Comment thread codex-rs/core/src/client.rs Outdated
.reasoning_summary_delivery
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner) = Some(reasoning_summary_delivery);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems like we're doing this so we can special case it and change this while a thread is "active." I don't think we have equivalent methods for other fields on this struct, is this strictly necessary?

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

2 participants