From 6ee2bf02e3d5e8f035af79fe7d2f2d55b3f8db91 Mon Sep 17 00:00:00 2001 From: stevef Date: Mon, 13 Apr 2026 21:34:07 +0200 Subject: [PATCH] fix: robust parameter mapping for inbound pico messages --- pkg/channels/pico/pico.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/channels/pico/pico.go b/pkg/channels/pico/pico.go index 493d79d72..a92ba55b7 100644 --- a/pkg/channels/pico/pico.go +++ b/pkg/channels/pico/pico.go @@ -559,6 +559,19 @@ func (c *PicoChannel) handleMessage(pc *picoConn, msg PicoMessage) { // handleMessageSend processes an inbound message.send from a client. func (c *PicoChannel) handleMessageSend(pc *picoConn, msg PicoMessage) { content, _ := msg.Payload["content"].(string) + + // Robust parameter mapping for HDN compatibility + if content == "" { + // Fallback to other common field names used by different HDN versions + if c, ok := msg.Payload["prompt"].(string); ok { + content = c + } else if m, ok := msg.Payload["message"].(string); ok { + content = m + } else if q, ok := msg.Payload["query"].(string); ok { + content = q + } + } + media, err := parseInlineImageMedia(msg.Payload) if err != nil { errMsg := newErrorWithPayload("invalid_media", err.Error(), map[string]any{