fix(mail): resolve beads-native queues/channels by name

resolveByName() only checked config-based queues/channels, missing
beads-native ones (gt:queue, gt:channel). Added lookup for both.

Also added LookupQueueByName to beads package for parity with
LookupChannelByName.

Fixes: gt-l5qbi3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jack
2026-01-17 03:40:24 -08:00
committed by Steve Yegge
parent d4ad4c0726
commit 38d3c0c4f1
2 changed files with 54 additions and 1 deletions

View File

@@ -171,7 +171,29 @@ func (r *Resolver) resolveByName(name string) ([]Recipient, error) {
}
}
// Check for queue in config
// Check for beads-native queue
if r.beads != nil {
_, queueFields, err := r.beads.LookupQueueByName(name)
if err != nil {
return nil, err
}
if queueFields != nil {
foundQueue = true
}
}
// Check for beads-native channel
if r.beads != nil {
_, channelFields, err := r.beads.LookupChannelByName(name)
if err != nil {
return nil, err
}
if channelFields != nil {
foundChannel = true
}
}
// Check for queue/channel in config (legacy)
if r.townRoot != "" {
cfg, err := config.LoadMessagingConfig(config.MessagingConfigPath(r.townRoot))
if err == nil && cfg != nil {