Repository navigation
fix(voice): preserve speech and model work - #589
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6b6277936
ℹ️ 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 (@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 (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3bc75676a
ℹ️ 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 (@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 (@codex) address that feedback".
|
actually, holding off on merging this since I believe the SDK might fix this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13a055ea95
ℹ️ 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 (@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 (@codex) address that feedback".
| && (owners[&index].voice_turn.is_some() | ||
| || session_of[index].is_some_and(|session| user_sessions.contains(&session))) | ||
| { | ||
| plan.ignored.insert(index); |
There was a problem hiding this comment.
Validate speech references before skipping them
When a user_speech span has an explicit or inherited turn.id that is unresolved or points to a non-turn, voice_turn.is_some() sends it through this continue before the resolver below can record an import failure. Fresh evidence in this commit is that it adds a preservation path for unowned user_speech and states invalid explicit references retain diagnostics; validate these references before omitting the spans.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
this is fine; skip if we have an invalid turn
working with David Elner (@delner) on the last mile portion for cascaded/gpt-realtime traces
LiveKit records generated output in
llm_responseand played speech inagent_speech. Represent voice model calls as existingllm_analysiswork so the thread displays played speech once, while generated messages, tool calls, usage, and timing remain inspectable. NoVoiceTurnRole, public schema additions, or UI changes.Also preserve unowned
user_speechintervals as empty standalone turns when the session has no explicit user turns. Keep their IDs and actual intervals without inventing transcripts or replies. Other unowned modeled voice spans are skipped; invalid explicit turn references retain diagnostics. Loaded empty requests remain hidden by the current UI.When no explicit or inherited
turn.idexists, use the nearest structuraluser_turnoragent_turnancestor in the same session. The search is bounded. Missing ownership is skipped, and invalid explicit IDs remain nonfatal diagnostics; healthy spans continue rendering. No timestamp or text matching.The Realtime fixture covers the attached conversation’s greeting, tool exchange, and closing reply in one fixture and regression test. Expected turns live in JSON; the shared runner checks batching, body/header imports, randomized load order, and coverage. The same fixture is also tested with all
turn.idfields removed. The orphan-speech and tool fixtures cover separate ownership cases. Implementation reference: Python SDK #1069.Validation
03f15aa6with13a055ea: the supplied trace is unchanged; a copy with onlyturn.idremoved regains assistant speech and model work. Both runs have no browser page errors.The hosted app still needs its Lingua pin/build updated. Audio-only bubbles and per-turn playback are outside this change.
Screenshots
Latest change,
03f15aa6→13a055ea, with the same app and viewport.Supplied trace with IDs intact: unchanged.
Open full size
Open full size
Same trace with only
turn.idremoved, before: assistant speech and model work are missing.Open full size
After: structural ownership restores the conversation and model work.
Open full size