]> git.giacomolli.uk - onechat/blobdiff - telegram.go
Give each subagent its own prompt cache key
[onechat] / telegram.go
index c78080d75edaad736b204c3a223901bd01200418..c560104c52b83cb4d590d60b939c2de04af277f2 100644 (file)
@@ -163,7 +163,7 @@ type TelegramBot struct {
 // stop the agent.
 func (b *TelegramBot) Notify(event Event) {
        switch event.Kind {
 // stop the agent.
 func (b *TelegramBot) Notify(event Event) {
        switch event.Kind {
-       case "busy", "idle", "reply", "error", "notice":
+       case "busy", "idle", "reply", "error", "notice", "subagent", "work":
        case "user":
                if event.Source == telegramSource {
                        return
        case "user":
                if event.Source == telegramSource {
                        return
@@ -540,11 +540,17 @@ func telegramSplitMessage(text string, limit int) []string {
 }
 
 // telegramText returns the text of event for the chat. A user message of
 }
 
 // telegramText returns the text of event for the chat. A user message of
-// another client has its source as a mark.
+// another client has its source as a mark. A subagent shows only its start and
+// how its run ended, because the reply of the agent carries the content of the
+// report.
 func telegramText(event Event) string {
        switch event.Kind {
        case "user":
                return "[" + event.Source + "] " + event.Text
 func telegramText(event Event) string {
        switch event.Kind {
        case "user":
                return "[" + event.Source + "] " + event.Text
+       case "subagent":
+               return "[" + event.Text + "] started"
+       case "work":
+               return "[" + event.Source + "] " + event.Status
        case "error":
                return "Error: " + event.Text
        default:
        case "error":
                return "Error: " + event.Text
        default: