Repository navigation
fix(talk): bound WebRTC tool-call lifecycle - #117732
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 10:01 PM ET / August 2, 2026, 02:01 UTC. ClawSweeper reviewWhat this changesThe PR makes Control UI WebRTC Talk execute OpenAI function calls only from completed response output, bounds retained call state, and ignores provisional or late duplicate events. Merge readinessNo concrete patch defect was found in the reviewed lifecycle path, but this member-authored, maintainer-labeled PR should remain open for maintainer review because direct inspection of the pinned OpenAI Realtime dependency contract was unavailable in this checkout. The implementation appears to repair the current unbounded provisional-argument path at the WebRTC adapter boundary and has focused plus reported live-browser evidence. Priority: P1 Review scores
Verification
How this fits togetherControl UI Talk receives OpenAI Realtime events through a WebRTC data channel and translates allowed function calls into local control, consult, and camera actions. This transport is responsible for deciding which provider events are executable and for ending or suppressing work when the Talk session closes. flowchart LR
A[OpenAI Realtime events] --> B[WebRTC Talk transport]
B --> C[Completed response validation]
C --> D[Call ID dedupe and argument bounds]
D --> E[Control, consult, or camera action]
D --> F[Visible session close at safety limit]
E --> G[Function output and next response]
Decision needed
Why: The code and focused tests support the local repair, but repository policy requires direct dependency-contract evidence that this read-only checkout could not access. Before merge
Agent review detailsSecurityNone. PR surfaceSource +45, Tests +271, Docs +1. Total +317 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep execution ownership in the WebRTC adapter, retain the bounded terminal-response design, and complete an exact OpenAI Realtime contract check plus current-head CI before merging. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main buffers every provisional argument delta and executes on the provisional arguments-done event, while the branch provides focused tests for the corrected terminal-response path. This review did not run a live reproduction locally. Is this the best way to solve the issue? Unclear pending direct OpenAI dependency inspection: the WebRTC adapter is the appropriate owner and the branch removes the provisional buffer rather than adding a parallel state machine, but the provider event contract could not be independently read in this environment. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b2da7aa106dc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Talk-owner confirmation: confirmed. For this adapter, a successful
The 1,024-call close is an accepted session-safety policy. It is intentionally terminal because evicting old IDs would allow duplicate execution in an unusually long session. Evidence checked on this exact head:
ClawSweeper rank-up move applied; no code change needed. |
|
Exact-head merge-risk disposition for
Both ClawSweeper rank-up moves are applied. No further code change is needed. |
|
Landed on Parents:
Merged-tree verification:
|
* commit 'aaeedab833398417cf422b2de96a9b1d10f4287b': test(talk): align browser E2E tool completion docs(changelog): note bounded WebRTC tool calls test(talk): split WebRTC tool lifecycle coverage test(talk): align WebRTC tool-call fixtures fix(talk): accept optional realtime item ids fix(talk): narrow completed response payload test(talk): cover WebRTC terminal tool calls fix(talk): bound WebRTC tool-call lifecycle
Related: #116201
What Problem This Solves
Fixes an issue where long or replayed OpenAI WebRTC Talk sessions could retain unbounded provisional tool arguments and terminal call identities, and could execute provisional or duplicate function-call events.
Why This Change Was Made
The WebRTC adapter now treats a successful
response.doneas the sole executable tool-call boundary, matching the OpenAI Realtime contract. It ignores provisional argument events, accepts optional response/item IDs, bounds authoritative arguments to 256,000 UTF-8 bytes, caps terminal call identities at 1,024 without eviction, and ignores late async results after close.This remains WebRTC-local. It does not introduce a generic provider state machine or change provider, config, environment-variable, protocol, or public SDK surface.
User Impact
Browser Talk keeps normal control, consult, and camera tool behavior while preventing session-long memory growth and duplicate execution from late terminal replay. Extreme call-cardinality overflow closes visibly instead of weakening dedupe.
Evidence
gpt-realtime-2.1browser proof passed atf82d2dde144ff257fb177e6b639169387ded23fe:git diff --checkand targeted formatting passed.response.doneincludes all response output items and requires checking response status; provisional arguments-done may also be emitted for interrupted, incomplete, or cancelled responses.AI-assisted: yes. The implementation and proof were reviewed by a maintainer.