feat(cli)!: add agent-first chat and session ask output modes

This commit is contained in:
coconut-yc
2026-06-21 02:41:36 +08:00
committed by lyingbug
parent 238297e2c5
commit 9437e1ac3c
18 changed files with 1317 additions and 355 deletions
+6 -1
View File
@@ -65,7 +65,12 @@ func (a *Accumulator) Append(r *sdk.StreamResponse) {
a.AssistantMessageID = r.AssistantMessageID
}
// Capture references whenever they arrive - they may land on a
// dedicated `references` event before the terminal `complete`.
// dedicated `references` event before the terminal `complete`. Strip the
// bulky per-chunk Content so the buffered envelope stays small: agents
// consume the index (id / parent_chunk_id / title / score / snippet) and
// fetch full passages on demand via `chunk view`. This runs after SSE
// parsing, so it governs outgoing envelope size — the incoming line-size
// limit is the scanner buffer's job, not this one.
if r.KnowledgeReferences != nil {
a.References = r.KnowledgeReferences
}