feat: echo MiniApp commands to chat for user visibility

When a command is sent from the MiniApp (source=webapp), echo it
to the Telegram chat before processing so the user can confirm
what was sent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dj-oyu 2026-02-22 08:56:37 +09:00
parent 29bbb4ea7b
commit 08dfe188c1

View file

@ -242,6 +242,16 @@ func (al *AgentLoop) Run(ctx context.Context) error {
continue
}
// Echo commands sent from the Mini App so the user can see what was sent.
if msg.Metadata["source"] == "webapp" && msg.Content != "" {
al.bus.PublishOutbound(bus.OutboundMessage{
Channel: msg.Channel,
ChatID: msg.ChatID,
Content: "via MiniApp: " + msg.Content,
SkipPlaceholder: true,
})
}
// Fast path: handle slash commands immediately without blocking the LLM worker.
if response, handled := al.handleCommand(ctx, msg); handled {
if response != "" {