Repository navigation
feat(voice): type on_interrupt callback payload as InterruptMessage (AA-1428) - #138
Open
wenzhu1587 wants to merge 1 commit into
Open
wenzhu1587 wants to merge 1 commit into
wenzhu1587 wants to merge 1 commit into
Conversation
…AA-1428) The interrupt callback already receives the parsed ConversationRelay InterruptMessage (utterance_until_interrupt, duration_until_interrupt_ms), but it was typed as Any and undocumented. Type it as InterruptMessage, export InterruptMessage from tac.models, and document the fields in the on_interrupt docstring. Non-breaking: the runtime value is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wenzhu1587
requested review from
ryanrishi,
ryanrouleau and
xinghaohuang91
as code owners
October 16, 2026 02:49
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes preserve runtime behavior, match the existing payload contract, and have no identified blocking issues.
0 open findings
What changed in this PR
Makes voice interruption callback fields discoverable through explicit typing and published documentation, without changing runtime behavior.
Changes:
- Types interrupt callback payloads as
InterruptMessageand exports the model. - Documents payload fields with a usage example.
- Adds export coverage and strengthens callback payload assertions.
| File | Description |
|---|---|
tests/test_voice_channel.py |
Verifies callback session and interrupt details. |
tests/test_interrupt.py |
Tests the public model export. |
src/tac/models/__init__.py |
Exports InterruptMessage. |
src/tac/core/tac.py |
Updates callback types and documentation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses AA-1428 without a breaking change. The ticket asks that the Python
on_interruptcallback provide the same detail as TypeScript'sonInterrupt(conversationId,utteranceUntilInterrupt,durationUntilInterruptMs,session).Python already passes all of this. The second callback argument is the parsed ConversationRelay
InterruptMessage, and the session carriesconversation_id. But the argument was typedAnyand undocumented, so callers couldn't discover the fields. This PR:InterruptMessageinon_interrupt,_interrupt_callback, andtrigger_interrupt.InterruptMessagefromtac.modelsso callers can annotate their callbacks.on_interruptdocstring (published API docs) to describeutterance_until_interrupt/duration_until_interrupt_mswith a working example.The runtime value is unchanged. Callbacks annotated
(session, data: Any)still type-check.Deferred (per discussion):
InterruptParamssingle-object signature: breaking, so it goes with the AA-1427on_message_readyparams-object change. Both callbacks then move together.on_interruptnot fired by the OpenAI Realtime provider: barge-in is handled and tracked in analytics, buttrigger_interruptisn't called. The TS SDK has the same gap, so it should be a separate cross-SDK follow-up.Type of Change
Checklist
New and updated tests:
InterruptMessageis importable fromtac.models.utterance_until_interrupt/duration_until_interrupt_ms. Previously it only checked that no exception was raised.make checkpasses.SDK Parity
This is the Python SDK. If this change affects shared functionality, ensure the TypeScript SDK is updated as well.
InterruptCallbackalready exposes these fields.🤖 Generated with Claude Code