Skip to content

Preserve pending realtime speech when a call ends - #62299

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/657491f1d7e446a1a48e22189758810c8bdd82cb
Nov 18, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/657491f1d7e446a1a48e22189758810c8bdd82cb

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Preserve pending realtime speech when a call ends

Why

A realtime call can end with completed speech that has yet to reach a
Codex turn. The next turn needs that context even if the call's transport
has already disconnected.

What changed

  • For V3 calls with realtime frame history enabled, save pending speech
    as context for the next turn. Restore it on thread reload and exclude
    it from the turn count used by rollback.
  • Drain already received transcript events and settle pending handoffs
    before saving the call's closing marker. Report recovery required if
    shutdown cannot confirm that history was saved.
  • Keep transport detach separate from ending a call. Reattaching restores
    saved pending speech, and an open call can be ended from persisted
    history after a reload. Use the call ID for TUI attachments so successive
    calls on one thread have distinct history.

Testing

Add coverage for queued speech at hangup, reconnect and stop after
reload, retries after an uncertain write, and rollback across saved
session-end context.

## Why

A realtime call can end with completed speech that has yet to reach a
Codex turn. The next turn needs that context even if the call's transport
has already disconnected.

## What changed

- For V3 calls with realtime frame history enabled, save pending speech
  as context for the next turn. Restore it on thread reload and exclude
  it from the turn count used by rollback.
- Drain already received transcript events and settle pending handoffs
  before saving the call's closing marker. Report recovery required if
  shutdown cannot confirm that history was saved.
- Keep transport detach separate from ending a call. Reattaching restores
  saved pending speech, and an open call can be ended from persisted
  history after a reload. Use the call ID for TUI attachments so successive
  calls on one thread have distinct history.

## Testing

Add coverage for queued speech at hangup, reconnect and stop after
reload, retries after an uncertain write, and rollback across saved
session-end context.

GitOrigin-RevId: 657491f1d7e446a1a48e22189758810c8bdd82cb
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/657491f1d7e446a1a48e22189758810c8bdd82cb branch from 9d6c9da to bd00a8a Compare November 18, 2026 15:24
@copyberry
copyberry Bot merged commit bd00a8a into main Nov 18, 2026
14 of 47 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/657491f1d7e446a1a48e22189758810c8bdd82cb branch November 18, 2026 15:25
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-18T15:25:10.769264Z bd00a8a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch was previously deployed

1 inactive deployment
issue-triage — bd00a8a4 Deployed Nov 18, 2026 by Halven08 via Identify potential duplicates (open issues fallback) #64191
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.

3 participants