Skip to content

feat: support live transcription replay - #345

Open
jpr5 wants to merge 2 commits into
mainfrom
fix/live-transcribe-support-pr
Open

feat: support live transcription replay#345
jpr5 wants to merge 2 commits into
mainfrom
fix/live-transcribe-support-pr

Conversation

@jpr5

@jpr5 jpr5 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Aligns OpenAI transcription HTTP, Realtime, recorder, and replay behavior with the current nested GA wire contract.

  • Dedicated intent=transcription sockets ignore regular realtime query models.
  • GA session events serialize audio.input.format and audio.input.transcription; Beta keeps its flat shim.
  • Current input-transcription configuration emits progressive transcript events, retains languages, preserves empty transcript fixtures, honors stream timing and interruption controls, and ends at typed transcript.text.done without a [DONE] sentinel.

Baseline vs Candidate Local Proof

The exact probe ran against a clean detached 8d425a4 worktree and the isolated candidate worktree. It used real local HTTP, WebSocket, recorder proxy, persisted fixture, and replay paths.

Red: clean 8d425a4

INTENT_MODELS gpt-realtime-2 wrong-model
CURRENT_GA {"voice":null,"input_audio_format":"audio/pcm","output_audio_format":null,"input_audio_noise_reduction":null,"input_audio_transcription":{"model":"gpt-transcribe"}} session.created,session.updated,input_audio_buffer.committed
INVALID_MODEL Model gpt-realtime-2 does not support session type transcription
HTTP interrupt 200 "data: {\"type\":\"transcript.text.delta\",\"delta\":\"ab\"} ... data: {\"type\":\"transcript.text.done\",\"text\":\"abcdefgh\"}\n\nevent: done\ndata: [DONE]\n\n"
HTTP missing 404 "{\"error\":{\"message\":\"No fixture matched\",\"type\":\"invalid_request_error\",\"code\":\"no_fixture_match\"}}"
HTTP error 422 "{\"error\":{\"message\":\"bad transcription\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":null}}"
RECORDED_FIXTURES ... "response":{"transcription":{"text":"hello"}}

Green: candidate 6ae6ec4

INTENT_MODELS gpt-transcribe gpt-transcribe
CURRENT_GA {"input":{"format":{"type":"audio/pcm"},"noise_reduction":null,"transcription":{"model":"gpt-transcribe"}},"output":{"format":null,"voice":null}} session.created,session.updated,input_audio_buffer.committed,conversation.item.added,conversation.item.input_audio_transcription.delta...,conversation.item.input_audio_transcription.completed
INVALID_MODEL Model wrong-model does not support session type transcription
HTTP interrupt FETCH_ERROR TypeError: terminated
HTTP missing 404 "{\"error\":{\"message\":\"No fixture matched\",\"type\":\"invalid_request_error\",\"code\":\"no_fixture_match\"}}"
HTTP error 422 "{\"error\":{\"message\":\"bad transcription\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":null}}"
RECORDED_FIXTURES ... "response":{"transcription":{"text":"hello","languages":[{"code":"en"}]}}

Validation

prettier --check  PASS
eslint            PASS
tsc --noEmit      PASS
Focused protocol suites: 312 tests PASS
Full pnpm test and pnpm build completed after the GA conformance update with no failure output.

Fourth-Pass Red-Green

Red: terminal reported four stale GA expectations (legacy audio transcription field and missing ).

Green:
RUN v3.2.4 /private/tmp/aimock-live-transcribe-pr.0mGErr

✓ src/tests/ws-realtime.test.ts (83 tests) 7614ms

Test Files 1 passed (1)
Tests 83 passed (83)
Start at 14:39:20
Duration 8.13s (transform 235ms, setup 0ms, collect 300ms, tests 7.61s, environment 0ms, prepare 44ms) passed 83/83. Direct clean-baseline vs candidate VAD probe changed into nested , progressive live deltas, and journal interruption before completion. Full format, lint, typecheck, 145-file test suite, and build passed.

Fourth-pass proof: red terminal ws-realtime test had four stale GA audio expectation failures. Green exact file: 83 of 83 passed. Clean baseline VAD emitted an error; candidate returned nested audio.input.turn_detection server_vad, progressive deltas, and truncateAfterChunks journal interruption. Full format, lint, typecheck, 145-file tests, and build passed.

Fifth-pass red-green: baseline emitted GA session type conversation, top-level turn_detection, and accepted model mutation. Candidate emits realtime for normal GA sessions, keeps VAD under audio.input, rejects established model mutation, and preserves explicit transcription/translation session types. Red conformance test at ws-api-conformance line 618 is now green (66/66); full format, lint, tsc, tests, and build passed.

Sixth-Pass Red-Green

Red: clean baseline 2871866 accepted a real WebSocket mixed model/type update and persisted gpt-4o-transcribe transcription must-not-mutate.

Green: candidate returned error invalid_session_config; its next valid update reported gpt-realtime-mini realtime safe, proving rejection occurs before any session mutation. Live-transcription interruption now uses socket destruction and journals the interruption.

Validation: focused ws-realtime suite 83/83 passed. Full format check, lint, typecheck, test suite, and build passed locally.

P2 Coverage Hardening

Commit f2ffc7e adds tests only; it does not change runtime behavior. The clean 71452a7 baseline already demonstrated the documented intent=transcription strict no-match and ErrorResponse paths, versioned model matching, abrupt interrupted socket termination with journal details, and scheduled inter-frame delivery.

The new direct tests cover those established paths, HTTP stream=true JSON errors, and JSON/SSE recorder-to-local-replay preservation of languages and usage. Applied as a test-only diff to detached 71452a7, the focused suite passed 132/132; the candidate focused suite also passed 132/132. Full format, lint, typecheck, test, and build passed on the candidate.

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@345

commit: 23aca19

@jpr5
jpr5 force-pushed the fix/live-transcribe-support-pr branch from f2ffc7e to 23aca19 Compare July 30, 2026 01:54
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