[codex] control automatic realtime handoff delivery#27986
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
cb79a9a to
45824de
Compare
45824de to
30351ca
Compare
97b6d25 to
8d0d92d
Compare
774e7bc to
8bb3cd6
Compare
b0e39c8 to
7c0b430
Compare
7c0b430 to
0b50ce5
Compare
| enum RealtimeOutbound { | ||
| StandaloneHandoff { text: String }, | ||
| HandoffUpdate { handoff_id: String, text: String }, | ||
| HandoffAppend { handoff_id: String, text: String }, |
There was a problem hiding this comment.
why do we need a new outbound type here?
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b50ce5dbf
ℹ️ 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".
| } else if handoff.session_kind == RealtimeSessionKind::V1 | ||
| && handoff.codex_response_handoff_prefix.is_some() | ||
| { |
There was a problem hiding this comment.
Preserve default routing for empty handoff prefixes
When a client sends codexResponseHandoffPrefix: "" for a V1 active handoff, this is_some() check takes the new direct HandoffAppend path even though realtime_backend_item treats the empty prefix as absent. That bypasses the existing send_conversation_function_call_output path, so the response loses the default "Agent Final Message" wrapper that omission/null still gets; clients that bind an empty text input instead of omitting the field will silently change realtime behavior. Consider checking for a non-empty prefix before switching paths.
Useful? React with 👍 / 👎.
0b50ce5 to
1cd9010
Compare
1cd9010 to
b226c0b
Compare
|
I have read the CLA Document and I hereby sign the CLA |
|
/merge |
What
Built on the realtime speech-control plumbing merged in #27917.
codexResponseHandoffPrefixtothread/realtime/start.conversation.handoff.append; final answers remain unprefixed.clientManagedHandoffs. When true, core suppresses automatic response handoffs and completion output so delivery is controlled by explicit client append APIs.codexResponsesAsItems: truecontinues to select item routing when client-managed mode is disabled.Why
Voice clients need two delivery policies: automatic background context with silent commentary instructions and fully client-owned handoffs. Phase-aware prefixing keeps routine commentary silent without suppressing the final answer, while client-managed mode lets an app decide exactly which updates to append.
Validation
just fmtcargo test -p codex-app-server-protocol serialize_thread_realtime_startRUST_MIN_STACK=16777216 cargo test -p codex-core --test all conversation_handoff_persists_across_item_done_until_turn_completeRUST_MIN_STACK=16777216 cargo test -p codex-app-server --test all webrtc_v1_client_managed_handoffs_disable_automatic_outputRUST_MIN_STACK=16777216 cargo test -p codex-app-server --test all webrtc_v1_final_automatic_handoff_omits_silent_prefixcargo build -p codex-cli --bin codexThe explicit
RUST_MIN_STACKavoids a macOS Tokio test-worker stack overflow seen with the default test environment.