Merge branch 'worktree-agent-aae8756320b8309f6'

# Conflicts:
#	app/lib/features/chat/conversation/chat_thread_view.dart
#	app/tool/perf/perf_fixture.dart
#	internal/protocol/message.go
#	internal/server/chat_hub.go
This commit is contained in:
2026-11-09 16:56:55 +00:00
54 changed files with 4192 additions and 22 deletions
+55
View File
@@ -0,0 +1,55 @@
package protocol
// ChatShown is the pushed frame type for an item a chat's model showed the
// operator through the Pipelines tools (show_file, show_image, show_html,
// notify). The chat_subscribe reply carries the retained list in the same
// ChatShown field.
const ChatShown = "chat_shown"
// The ChatShownItem kinds.
const (
ChatShownFile = "file"
ChatShownImage = "image"
ChatShownHTML = "html"
ChatShownNotify = "notify"
)
// ChatShownLimit bounds the items retained per chat, and ChatShownHTMLBudget
// the HTML bytes kept across them: older documents beyond it keep their entry
// but drop the body (Expired).
const (
ChatShownLimit = 100
ChatShownHTMLBudget = 2 << 20
)
// ChatShownFrame is one chat's shown items, oldest first.
type ChatShownFrame struct {
SessionID string `json:"session_id"`
Items []ChatShownItem `json:"items"`
}
// ChatShownItem is one entry. A file or image Path is an absolute path on the
// chat's own machine, served by that machine's /files endpoint; URL is an
// https image address the client loads without credentials.
type ChatShownItem struct {
ID string `json:"id"`
Kind string `json:"kind"`
CreatedAt int64 `json:"created_at"`
Title string `json:"title,omitempty"`
Path string `json:"path,omitempty"`
Name string `json:"name,omitempty"`
Size int64 `json:"size,omitempty"`
Mime string `json:"mime,omitempty"`
URL string `json:"url,omitempty"`
Alt string `json:"alt,omitempty"`
HTML string `json:"html,omitempty"`
HTMLBytes int `json:"html_bytes,omitempty"`
// HeightHint is the model's preferred inline height in logical pixels.
HeightHint int `json:"height_hint,omitempty"`
Expired bool `json:"expired,omitempty"`
Message string `json:"message,omitempty"`
Priority string `json:"priority,omitempty"`
Delivered bool `json:"delivered,omitempty"`
// Detail says why a notification was not delivered.
Detail string `json:"detail,omitempty"`
}
+4
View File
@@ -259,6 +259,10 @@ type Message struct {
ChatTurnDiffList *ChatTurnDiffList `json:"chat_turn_diffs,omitempty"`
ChatTurnDiff *ChatTurnDiff `json:"chat_turn_diff,omitempty"`
ChatUnqueue *ChatUnqueueRequest `json:"chat_unqueue,omitempty"`
// ChatShown carries the items the chat's model showed through the Pipelines
// tools: the retained list on the chat_subscribe reply, one new item on a
// pushed chat_shown frame.
ChatShown *ChatShownFrame `json:"chat_shown,omitempty"`
// ChatDirectories carries the operator's directory choices on a
// chat_directories response (home first, then recent operator-session
// directories, deduplicated and bounded). Additive/omitempty so older peers