Show injected Claude input as agent reports and notices, not operator bubbles
Claude Code records subagent/peer reports, task notifications, reminders and skill bodies as user-role entries. Classify them server-side (history and live stream) by origin/isMeta/queued_command mode: reports become kind agent_report, task notifications kind notice, harness meta is hidden, and the mid-turn wrapper is unwrapped to the operator's text. The app draws a collapsed Agent report card and a one-line system notice on the agent's side.
This commit is contained in:
@@ -184,6 +184,21 @@ const (
|
||||
ChatRoleAssistant = "assistant"
|
||||
)
|
||||
|
||||
// ChatMessage.Kind (and ChatEventFrame.MessageKind) values. A message with a
|
||||
// kind is content the harness delivered into the session, never a turn the
|
||||
// operator sent: it carries role assistant so an older client that ignores the
|
||||
// kind still draws it on the agent's side, never as the operator's bubble.
|
||||
//
|
||||
// ChatMessageKindAgentReport is a report another agent (a delegated subagent or
|
||||
// a peer session) delivered; its one text part is the report, and the part's
|
||||
// Name carries the sender's label when the harness recorded one.
|
||||
// ChatMessageKindNotice is a one-line harness notice, such as a background task
|
||||
// finishing; its one text part is the line.
|
||||
const (
|
||||
ChatMessageKindAgentReport = "agent_report"
|
||||
ChatMessageKindNotice = "notice"
|
||||
)
|
||||
|
||||
// ChatModel is one model the current chat harness can switch to. ID is the
|
||||
// provider's model id, Provider its provider id, Name the harness's display name.
|
||||
type ChatModel struct {
|
||||
@@ -436,9 +451,12 @@ type ChatMessage struct {
|
||||
// Client is the sending device's label on a user turn the server echoed, so a
|
||||
// resumed transcript still says who sent the message. It is empty on an
|
||||
// assistant turn.
|
||||
Client string `json:"client,omitempty"`
|
||||
OperationID string `json:"operation_id,omitempty"`
|
||||
Parts []ChatPart `json:"parts"`
|
||||
Client string `json:"client,omitempty"`
|
||||
OperationID string `json:"operation_id,omitempty"`
|
||||
// Kind is empty for an ordinary user or assistant turn, or one of the
|
||||
// ChatMessageKind values for content the harness injected.
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Parts []ChatPart `json:"parts"`
|
||||
}
|
||||
|
||||
// ChatDeltaPartID is the stable part id an incremental text or reasoning delta
|
||||
@@ -539,6 +557,9 @@ type ChatEventFrame struct {
|
||||
// transcript can say who sent the message. It is empty on assistant frames.
|
||||
Client string `json:"client,omitempty"`
|
||||
OperationID string `json:"operation_id,omitempty"`
|
||||
// MessageKind is the ChatMessage.Kind of the message a text frame starts,
|
||||
// so a live agent report or notice is never drawn as an answer or a prompt.
|
||||
MessageKind string `json:"message_kind,omitempty"`
|
||||
}
|
||||
|
||||
// ChatCompaction is session activity, never a transcript message or tool.
|
||||
|
||||
Reference in New Issue
Block a user