Chat: draw agent follow-ups and automatic continues apart from the operator

The server now names a user turn's origin (followup, auto_continue,
auto_switch, scheduled) on chat messages, user frames and queued prompts,
from the prompt's operation id while it holds the prompt and from its own
text prefixes in history read later. Origin is a new field, so older
clients keep treating these as ordinary user turns.

The app draws an agent follow-up, auto-continue and account-switch prompt
as a quiet outlined card on the agent's side with an icon, label and the
schedule facts from the preamble; the operator's own scheduled message
keeps its bubble with a small Scheduled mark. Find searches the drawn text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 15:40:34 +00:00
parent 608b6b8edb
commit 9a6363b80e
22 changed files with 946 additions and 26 deletions
+2 -1
View File
@@ -100,7 +100,7 @@ func chatAutoSwitchText(from, to string) string {
if from == "" {
from = "the previous account"
}
return "[Sent automatically by Pipelines] Usage ran out on " + from + ", so Pipelines switched this chat to " + to + ". " +
return chatAutoSwitchTextPrefix + " Usage ran out on " + from + ", so Pipelines switched this chat to " + to + ". " +
"Before continuing: you already used up a full usage window on this task. Briefly check your progress against my original request and your plan, " +
"and make sure you are on track, not going in circles or off the rails. If something looks wrong, stop and ask me; otherwise continue where you left off."
}
@@ -274,6 +274,7 @@ func (h *chatHub) queueServerPrompt(ctx context.Context, broker chatBroker, sess
Part: &protocol.ChatPart{Type: protocol.ChatPartText, ID: "usr", Text: text},
Client: chatAutoSwitchClient,
OperationID: operationID,
Origin: chatPromptOrigin(operationID, false),
}, "")
return nil
}