Skip to content

fix(amd): fix negative zero in amd delay calculation#5650

Merged
chenghao-mou merged 1 commit into
mainfrom
chenghao/fix/amd-negative-zero
May 6, 2026
Merged

fix(amd): fix negative zero in amd delay calculation#5650
chenghao-mou merged 1 commit into
mainfrom
chenghao/fix/amd-negative-zero

Conversation

@chenghao-mou
Copy link
Copy Markdown
Member

No description provided.

@chenghao-mou chenghao-mou requested a review from a team May 5, 2026 19:38
Copy link
Copy Markdown
Contributor

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

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 potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@chenghao-mou chenghao-mou merged commit 42a4416 into main May 6, 2026
26 checks passed
@chenghao-mou chenghao-mou deleted the chenghao/fix/amd-negative-zero branch May 6, 2026 08:26
Copy link
Copy Markdown
Contributor

This is an automated Claude Code Routine created by @toubatbrian. Right now it is in experimentation stage. The automation evaluates merged PRs in livekit/agents and ports relevant core runtime / plugin changes into livekit/agents-js.

Decision for this PR: Skip port.

This PR fixes a negative-zero edge case in the delay field calculation when _speech_ended_at is None (replacing time.time() - (self._speech_ended_at or time.time()) with (time.time() - self._speech_ended_at) if self._speech_ended_at else 0.0).

The agents-js AMD module (agents/src/voice/amd.ts) does not currently expose this metric:

  • AMDResult in JS has only { category, transcript, reason, rawResponse, isMachine } — no delay or speech_duration fields.
  • The JS classifier tracks speechStartedAt but not speechEndedAt, so the negative-zero arithmetic this PR fixes has no analog there.

Since the buggy code path doesn't exist in agents-js, no port is needed. If/when the JS AMD adopts the delay/speech_duration metrics, the fix here should be applied at that time.


Generated by Claude Code

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.

3 participants