Skip to content

fix(agent): transcribe queued voice follow-ups#2828

Merged
afjcjsbx merged 2 commits into
sipeed:mainfrom
bogdanovich:fix/queued-voice-followups
May 9, 2026
Merged

fix(agent): transcribe queued voice follow-ups#2828
afjcjsbx merged 2 commits into
sipeed:mainfrom
bogdanovich:fix/queued-voice-followups

Conversation

@bogdanovich
Copy link
Copy Markdown
Contributor

Summary

  • transcribe queued voice follow-up messages before they are converted into steering messages
  • preserve normal voice-note behavior when a second inbound message arrives during an already active turn
  • add a regression test covering queued voice follow-ups

Problem

When a user sent a second Telegram voice note while the first turn was still running, the follow-up did not go through the normal inbound processMessage() path.

The active-turn branch in AgentLoop.Run() converted the inbound message directly into a steering providers.Message and enqueued it. That bypassed transcribeAudioInMessage(), so queued voice follow-ups could reach the model as raw [voice] media annotations instead of [voice: ...] text.

In practice this made follow-up additions easy to lose. A common example was:

  • first voice: what I ate
  • second voice while the first turn is still running: and also two pieces of bread

The second voice note could be ignored because it was never transcribed before steering injection.

Fix

Before enqueueing a follow-up into the steering queue, run the same audio transcription step used for normal inbound messages:

  • transcribe queued audio media refs
  • replace [voice] with [voice: ...]
  • preserve transcription placeholder behavior for queued follow-ups too

This keeps queued voice notes behaviorally consistent with ordinary turn starts.

Validation

  • go test ./pkg/agent -run 'TestAgentLoop_Run_(AutoContinuesLateSteeringMessage|QueuedVoiceMessageIsTranscribedBeforeSteering)' -count=1
  • go test ./pkg/agent -run 'TestProcessMessage_MessageTool|TestNewAgentLoop' -count=1

Copy link
Copy Markdown
Collaborator

@afjcjsbx afjcjsbx left a comment

Choose a reason for hiding this comment

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

this is an annoying picoclaw bug! thanks for the PR, LGTM!

@afjcjsbx afjcjsbx merged commit af90161 into sipeed:main May 9, 2026
4 checks passed
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.

2 participants