feat: enhance sentinel and add button support for telegram

This commit is contained in:
root
2026-02-14 17:00:21 +00:00
parent 1ac0fb123b
commit 4ed24b57e3
4 changed files with 63 additions and 4 deletions

View File

@@ -82,8 +82,9 @@ func NewAgentLoop(cfg *config.Config, msgBus *bus.MessageBus, provider providers
// Register message tool
messageTool := tools.NewMessageTool()
messageTool.SetSendCallback(func(channel, chatID, content string) error {
messageTool.SetSendCallback(func(channel, chatID, content string, buttons [][]bus.Button) error {
msgBus.PublishOutbound(bus.OutboundMessage{
Buttons: buttons,
Channel: channel,
ChatID: chatID,
Content: content,
@@ -210,6 +211,7 @@ func (al *AgentLoop) enqueueMessage(ctx context.Context, msg bus.InboundMessage)
case <-ctx.Done():
case <-time.After(2 * time.Second):
al.bus.PublishOutbound(bus.OutboundMessage{
Buttons: buttons,
Channel: msg.Channel,
ChatID: msg.ChatID,
Content: "Message queue is busy. Please try again shortly.",
@@ -275,6 +277,7 @@ func (al *AgentLoop) runSessionWorker(ctx context.Context, sessionKey string, wo
if response != "" {
al.bus.PublishOutbound(bus.OutboundMessage{
Buttons: buttons,
Channel: msg.Channel,
ChatID: msg.ChatID,
Content: response,