Skip to content

fix(gateway): keep media store aligned after reload#2783

Open
zhangxinping666 wants to merge 1 commit intosipeed:mainfrom
zhangxinping666:codex/fix-reload-voice-media-store
Open

fix(gateway): keep media store aligned after reload#2783
zhangxinping666 wants to merge 1 commit intosipeed:mainfrom
zhangxinping666:codex/fix-reload-voice-media-store

Conversation

@zhangxinping666
Copy link
Copy Markdown
Contributor

@zhangxinping666 zhangxinping666 commented May 6, 2026

Description

Keep the channel manager media store aligned with the agent media store after gateway reloads.

The reload path creates a fresh media store for cleanup lifecycle, then injects it into the agent. Existing channels were still holding the previous store, so inbound media refs created by channels after /reload could not be resolved by the agent during voice transcription. This updates the channel manager store and propagates it to existing channels before channel reload completes.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Code refactoring (no functional changes, no api changes)

AI Code Generation

  • Fully AI-generated (100% AI, 0% Human)
  • Mostly AI-generated (AI draft, Human verified/modified)
  • Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Fixes #2780

Technical Context (Skip for Docs)

  • Reference URL: [BUG] Reload config broke voice recognition #2780
  • Reasoning: Telegram and other channels store inbound media through the channel media store, while the agent resolves those refs for transcription. Both sides must share the same store after reload.

Test Environment

  • Hardware: PC
  • OS: Windows
  • Model/Provider: N/A
  • Channels: Telegram voice reload path covered by channel/gateway media-store tests

Evidence (Optional)

Click to view Logs/Screenshots
go test -tags goolm,stdjson ./pkg/channels -run '^TestSetMediaStorePropagatesToExistingChannels$' -count=1
ok  	github.com/sipeed/picoclaw/pkg/channels	0.251s

go test -tags goolm,stdjson ./pkg/channels -count=1
ok  	github.com/sipeed/picoclaw/pkg/channels	14.195s

go test -tags goolm,stdjson ./pkg/gateway -count=1
ok  	github.com/sipeed/picoclaw/pkg/gateway	1.025s

Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • Documentation update is not required for this internal bug fix.

@zhangxinping666 zhangxinping666 force-pushed the codex/fix-reload-voice-media-store branch from c0fb9d3 to 91f024e Compare May 10, 2026 02:28
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.

[BUG] Reload config broke voice recognition

1 participant