Skip to content

feat: Add native Session voice workflows - #5596

Merged
markstuart-oai merged 3 commits into
feat/codex-harnessfrom
feat/native-session-voice
Nov 7, 2026
Merged

markstuart-oai merged 3 commits into
feat/codex-harnessfrom
feat/native-session-voice

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request adds speech workflows backed by a caller-owned native Session. The optional agents.voice entrypoint and voice install extra reuse the existing speech pipeline and providers. NativeSessionVoiceWorkflow sends each transcript to the same Session and waits for its accepted final string before speech synthesis. It preserves configured output validation and repair. Structured results require a custom voice workflow that chooses what to speak.

The Session owns history and tools; the application answers approval requests. Early exit or cancellation stops and joins only its own Turn, including cancellation during submission. The speech pipeline closes suspended workflows when playback stops or synthesis fails. Cleanup no longer silently drops terminal synthesis errors. Examples cover WAV input and output, plus Realtime delegation through an ordinary function tool with explicit lifetime cleanup.

This PR targets feat/codex-harness.

Test plan

  • Focused native voice and architecture tests: 147 passed, 4 skipped, including all 33 voice tests. Real native fixtures cover inherited validation, rejected and repaired output, completion hooks, retained conversation, application replies, and Realtime delegation. Other tests cover structured-result rejection, cancellation races, and cleanup failures.
  • Focused typing, formatting, lint, and public import checks passed.
  • Required .agents/skills/code-change-verification/scripts/run.sh: passed on the current commit. Format, lint, Mypy, and Pyright passed. The parallel test phase had 5,627 passed and 250 skipped; the serial phase had 53 passed.
  • Native tests used the current Linux debug editable installation. Live speech services, audio devices, and release wheels were not qualified.

See the PR checks for current hosted CI results.

Issue number

None linked.

Checks

  • I've added new tests, if relevant
  • I've run the applicable checks in AGENTS.md, including .agents/skills/code-change-verification/scripts/run.sh when required
  • I've confirmed all required checks pass
  • I've completed the review required by AGENTS.md

@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 7, 2026 21:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T23:01:21.085683Z 7804ff6 New commits
🔒 Security Review ✅ Completed 2026-11-07T23:01:54.636005Z 7804ff6 New commits
ℹ️ 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.

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

Copy link
Copy Markdown

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: f38b326fcc

ℹ️ 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 src/agents/classic/voice/result.py Resolved

@jbeckwith-oai jbeckwith-oai 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.

Reviewed f38b326 with an independent static reviewer. Request changes for the existing finding #5596 (comment), independently confirmed: closing stream() immediately after session_ended bypasses _check_errors; the new synthesis_failed path also skips collecting the producer exception, and cleanup consumes task exceptions. A synthesis failure can therefore disappear at the terminal-event boundary. Preserve the synthesis exception through finalization while retaining caller cancellation precedence and joining owned tasks. The author has acknowledged a fix in progress; this review records the current commit's decision without duplicating the inline finding.

The remaining review found no additional actionable issues in exact-turn ownership, shielded admission, overlap rejection, failed-cleanup reservation, shared Session history, application-controlled approvals or example lifetime management. Hosted CI is pending. No candidate code or tests executed locally.

Comment thread src/agents/classic/voice/result.py Resolved
Comment thread src/agents/classic/voice/result.py Resolved
@markstuart-oai
markstuart-oai force-pushed the feat/native-session-voice branch from f38b326 to 1106e85 Compare November 7, 2026 22:13

@jbeckwith-oai jbeckwith-oai 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.

Re-reviewed 1106e85 with an independent static reviewer. The synthesis-error finding is fixed: finalization captures speech failures, joins owned tasks, preserves already-settled producer errors and caller cancellation precedence, and suppresses only the cancellation issued to stop a pending producer after synthesis failure. Native speech now inherits the Session output contract (no str override), waits for accepted final_output and rejects structured output before synthesis. Rejection, repair, completion acceptance, terminal close and ownership regressions cover these paths.

No new actionable findings. Approval supersedes my previous request changes. Hosted CI on this new head remains pending; this approval does not claim the earlier CI failure has been resolved. No candidate code or tests executed locally.

@markstuart-oai
markstuart-oai merged commit 9c347f2 into feat/codex-harness Nov 7, 2026
29 checks passed
@markstuart-oai
markstuart-oai deleted the feat/native-session-voice branch November 7, 2026 23:39
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.

3 participants