Skip to content

fix: timestamp say transcripts at speech start - #2421

Merged
chenghao-mou merged 1 commit into
mainfrom
doses-motorway-earbuds
Sep 4, 2026
Merged

fix: timestamp say transcripts at speech start#2421
chenghao-mou merged 1 commit into
mainfrom
doses-motorway-earbuds

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Ports livekit/agents#7110.

Interrupted session.say() transcripts now use the speech-start timestamp instead of commit time, preserving chronological chat context when a user interrupts an assistant turn that has already started.

Source diff coverage
  • Ported: livekit-agents/livekit/agents/voice/agent_activity.py -> agents/src/voice/agent_activity.ts. Set the say() assistant message createdAt from the recorded speech-start time, with Date.now() as the fallback. Adapted Python seconds to the target timestamp convention of milliseconds.
  • Adapted: tests/test_agent_session.py -> agents/src/voice/agent_activity_interrupted_commit.test.ts. Ported the source regression scenario and assertions for an interrupted on-enter say(), chronological system/assistant/user/assistant ordering, and equality between message creation and speech-start timestamps. agents-js lacks Python's FakeActions timeline harness, so the test uses a local AudioOutput fixture and direct synthesized frames; the timestamp assertion converts metrics seconds to message milliseconds.
  • Not applicable: none.

A patch changeset is included for @livekit/agents.

Validation:

  • pnpm test agents: 142 files passed, 2328 tests passed, 5 skipped
  • pnpm --filter @livekit/agents build
  • pnpm --filter @livekit/agents lint
  • pnpm exec prettier --check "agents/src/**/*.{ts,tsx,md,json}"
  • pnpm build: 39 packages built
  • cue-cli voice validation attempted, but the configured LiveKit endpoint rejected the supplied API key with 401 Unauthorized; the session was ended cleanly.

Ported from livekit/agents#7110

Original PR description

Interrupted session.say() transcripts used commit time, which let a user turn sort ahead of an assistant turn that had already started.

Use speech-start time for the assistant message. This matches the native realtime path and preserves chronological chat context.

Fixes #7108.
Addresses AGT-3437

Initial prompt and agent context

Model: GPT-5.6

can you investigate 7108?

but we should stamp the agent transcript based on speech start, right?

should we carry the started_speaking_at in the speech handle?

makes sense, yeah, let's do that.

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner September 4, 2026 10:05
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 383a872

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-krisp Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-protoface Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@chenghao-mou chenghao-mou self-assigned this Sep 4, 2026
@chenghao-mou
chenghao-mou merged commit bb16578 into main Sep 4, 2026
6 checks passed
@chenghao-mou
chenghao-mou deleted the doses-motorway-earbuds branch September 4, 2026 12:43
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