Skip to content

Propagate safety buffering treatment metadata - #29473

Merged
fc-oai merged 2 commits into
mainfrom
fc/safety-buffering-treatment
Jun 23, 2026
Merged

Propagate safety buffering treatment metadata#29473
fc-oai merged 2 commits into
mainfrom
fc/safety-buffering-treatment

Conversation

@fc-oai

@fc-oai fc-oai commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • read the request-scoped safety-buffering treatment from HTTP response headers and per-turn WebSocket metadata through one shared header parser
  • combine that treatment with Responses API safety-buffering signals
  • propagate showBufferingUi and nullable fasterModel through the existing model/safetyBuffering/updated app-server notification
  • update the app-server documentation and generated JSON and TypeScript schemas

The public implementation contains no model mapping or real model identifier. Tests and protocol examples use generic current-model and faster-model placeholders only.

Dependencies

Validation

  • Codex API tests: 129 passed
  • focused Codex core safety-buffering integration test passed
  • app-server protocol tests passed after regenerating schema fixtures
  • Clippy fix and repository formatting completed successfully

The broader app-server run compiled all changed crates and completed with 1,269 passing tests. Its remaining failures were unrelated environment limitations: macOS sandbox application was denied, one expected test binary was unavailable, and several existing subprocess tests timed out as a result.

@fc-oai
fc-oai force-pushed the fc/safety-buffering-treatment branch from 28cba3a to 5cd9fa9 Compare June 22, 2026 21:31
@fc-oai
fc-oai marked this pull request as ready for review June 22, 2026 22:32
@fc-oai
fc-oai requested a review from a team as a code owner June 22, 2026 22:32

@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: 5cd9fa92b9

ℹ️ 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 on lines +693 to +695
if let Some(headers) = event.headers.as_ref().and_then(Value::as_object)
&& let Some(treatment) =
treatment_from_headers(&json_headers_to_http_headers(headers))

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 Preserve array-valued websocket metadata headers

When the WebSocket response.metadata.headers object encodes header values as arrays, this path drops the safety-buffering headers before treatment_from_headers sees them, because json_headers_to_http_headers only converts scalar JSON values. The existing metadata header readers already accept arrays via json_value_as_string, so a response with headers like { "x-codex-safety-buffering-enabled": ["true"] } will still parse model/turn-state metadata but will emit showBufferingUi: false and no fasterModel.

Useful? React with 👍 / 👎.

pub use_cases: Vec<String>,
pub reasons: Vec<String>,
pub show_buffering_ui: bool,
pub faster_model: Option<String>,

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 Keep fasterModel required in the JSON schema

Because this v2 notification does not skip None, fasterModel is always serialized on the wire as either a string or null, and the generated TypeScript/README now describe it as a required nullable field; however leaving the field as a plain Option makes the regenerated JSON schemas omit fasterModel from required. JSON-schema clients can therefore generate an optional property that does not match the actual app-server payload, so mark the field required for schemars and regenerate the fixtures.

AGENTS.md reference: AGENTS.md:L267-L270

Useful? React with 👍 / 👎.

@fc-oai
fc-oai merged commit 7c22d37 into main Jun 23, 2026
46 of 47 checks passed
@fc-oai
fc-oai deleted the fc/safety-buffering-treatment branch June 23, 2026 02:51
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants