Skip to content

feat(realtime): a call's spoken turn shows its files as cards and can be branched - #810

Merged
richard-epsilla merged 4 commits into
mainfrom
rt/call-turn-files-branch
Dec 2, 2026
Merged

richard-epsilla merged 4 commits into
mainfrom
rt/call-turn-files-branch

Conversation

@github-actions

@github-actions github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What

A voice call's spoken turns now end the way typed turns do:

  1. File cards. A file a call's turn created or changed shows on that turn as a file card, with a download, as a typed turn's does.
  2. Branch. A call's turn says whether it can be branched (branchable). The console shows Branch on a call's replies, and a new call placed on the branch continues from that point.

Why

Typed turns run two end-of-turn steps: the produced files are collected and attached as container_file_citation annotations, and the workspace is checkpointed with the turn's id, which keeps the commit as the turn's branch point. A call's turns were saved without either step. So a call that ran run_command to create hello.md showed "Ran a command" but no file card, and no spoken turn could be branched.

How

Server (gateway/app.py)

  • When a call's turn is kept for the first time (as it completes, or at the hang-up for the last one), _realtime_turn_end runs the typed path's own functions: _collect_produced, the changed-files write (now _changed_put, shared with the typed path), _checkpoint(..., response_id=...) and _too_large_saved. The files become the same annotations (now built by _file_citations, shared with _RespTranslator.complete), and the record carries _branch_point.
  • When a turn is checkpointed: only a turn that ran run_command, the one tool of a call that changes the task's files. It runs after any command that is still running (the call's command lock), and only once the call has restored the task's workspace, so a sandbox that never restored it is never saved over the task's files.
  • Other turns changed no file, so no tarball is made for them. Their branch point is the previous response's point (a typed turn's, or the call's previous turn's), stored under the new turn's id. The runner accepts any commit in the history of the latest checkpoint, so a branch from such a turn restores the files as that turn left them. A turn with no earlier point (the first exchanges of a call in a new task, before any command) is not offered for a branch. It is not given a guessed point.
  • The end of a call saves the workspace again only when a command ran after the last turn that saved it.
  • A call's turns are kept one at a time per call, so the follower and the hang-up never both run a turn's end. A later write of a turn (for example, words transcribed late) carries the files and point that the first write kept.
  • Live call: the turn's end runs in the call's follower, outside the audio path. While a checkpoint is being written, a command issued in the same call waits for it. The audio does not.
  • POST /v1/harnesses/{id}/realtime/sessions takes branch_from: the call is placed in a new task branched from that reply. The task is made the same way a typed branch is (_branch_source, _branch_prepare), and the call starts from what was said up to that reply. A reply that can't be branched returns 409 branch_unavailable before anything is made. If the call then fails to start, it leaves no branch behind.

Console

  • A call's reply has Branch wherever its turn says it can be branched. It doesn't appear while a call is on. A voice task's branch draft is made by its first call (branch_from). After that, the branch is a task like any other.
  • A refused branch uses the same words as a refused text branch.

Docs: docs/realtime.md (call turns' files, branching a call's turn, branch_from) and docs/voice-calls.md.

Tests

  • gateway/tests/test_realtime_call_turn_end.py (13 tests, all failing on main):
    • a command turn's file card and download, plus its branch point;
    • a turn with no command takes no checkpoint and inherits the previous point;
    • no point before the first command;
    • a typed turn's point is carried into a call;
    • a command that never ran saves nothing;
    • words transcribed late keep the turn's files;
    • the turn closed by the hang-up, with a single checkpoint;
    • a command after the last kept turn is still saved at the end;
    • concurrent keeps run a turn's end once;
    • a branch from a call's turn made by the typed path's functions, where a new call on it hears the earlier exchange;
    • branch_from on the call route;
    • a refused branch and a call that didn't start leave nothing behind.
  • ui/.../Playground.callBranch.test.tsx (2 tests): a call turn carrying both files and branchable draws its card and Branch (none when the turn says it can't be branched, and none while a call is on). A voice branch's first call names the reply.
  • gateway/tests/test_turn_slot.py: the guard on where the turn gates are taken now counts two sites that hold them without a heartbeat (a typed branch's preparation and a call's with branch_from).
  • ui/.../voiceCall.test.ts (1 test): branch_from is sent, never together with session_id, and a refusal is shown in words.

🤖 Generated with Claude Code

richard-epsilla and others added 2 commits December 1, 2026 19:06
…iles are file cards, and it can be branched

A call's turns were saved with neither end-of-turn step a typed turn runs: a call that ran run_command to create
hello.md showed "Ran a command" and no file card, and no spoken turn could be branched.

- When a call's turn is kept for the first time (as it completes, or at the hang-up), a turn that ran run_command
  ends as a typed turn does, with the same functions: its produced files are collected and attached as
  container_file_citation annotations (file cards with a download), the changed-files set is written, and the
  task's workspace is checkpointed with the turn's id, so the commit is its branch point. After a command still
  running, and only once the call has restored the task's workspace.
- A turn that ran no command changed no file: no tarball is made for it. Its branch point is the one of the
  response before it (a typed turn's or the call's previous turn's), kept under its own id. A turn with no
  earlier point (a new task's first exchanges) is not offered for a branch rather than given a guessed one.
- The end of a call keeps the workspace again only when a command ran after the last turn that kept it.
- Keeping a call's turns is one at a time per call, so the follower and the hang-up never both take a turn's end.
- POST /v1/harnesses/{id}/realtime/sessions takes branch_from: the call is placed in a new task branched from that
  reply, made as a typed branch is (_branch_source, _branch_prepare), and starts from what was said up to it.
- Console: a call's reply has Branch where its turn says it can be branched (not while a call is on), and a voice
  branch's first call makes the branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on as a second site that holds the gates without a heartbeat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
unified-harness-protocol Ready Ready Preview Dec 2, 2026 5:16am UTC

Request Review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@richard-epsilla richard-epsilla left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: a call's turns get the typed path's end-of-turn file collection and checkpoint, so file cards and Branch work on calls; branch_from places a call on a branch with its history. Live proof 11/11; screenshots reviewed at four widths.

@richard-epsilla
richard-epsilla merged commit 379ec41 into main Dec 2, 2026
17 checks passed

This branch was successfully deployed

1 active deployment
Preview — 760244bd Deployed Dec 2, 2026 by vercel[bot]
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.

1 participant