[Bug]: Wiki 问答生成/恢复流时页面严重卡顿,单次 continue-stream 回放 47,196 个事件
Affected Component
Frontend UI
Bug Description
在 v0.8.0 的「维基问答 / builtin-wiki-researcher」中,一次回答生成期间页面出现非常明显的临时卡顿,回答完成后恢复正常。后端日志同时记录到大量流式事件、连续的长度截断后续轮生成,以及多次 continue-stream 历史事件回放。最大一次恢复请求需要回放 47,196 个事件。
希望协助排查:长回答叠加大量历史 SSE 事件恢复时,前端渲染/DOM 后处理是否存在性能瓶颈,以及后端恢复协议是否可以减少回放开销。
目前是现场问题报告及代码排查线索,尚未通过浏览器 CPU profile 确认唯一根因,也尚未形成稳定的最小复现。 请求最终返回 200、模型生成耗时约 3 分钟,并不代表页面交互卡顿本身已经被解释。
部署环境与本地修改说明
- 后端:
wechatopenai/weknora-app:v0.8.0,Docker Compose;PostgreSQL/ParadeDB、Redis、Neo4j、docreader 也运行在 Docker 中。 - 前端:从提交
1edcd54b43606d9079bb36650efe3f68707a79ea构建,静态文件直接由宿主机 Nginx 1.20.2 提供,通过同源 HTTP 入口访问,后端 API 由 Nginx 反向代理。 - 服务器:Rocky Linux 9.7 x86_64,8 vCPU,约 32 GB RAM;Docker 29.7.0、Docker Compose 5.3.1。
- 客户端:Windows,Codex 内置浏览器;未记录精确浏览器内核版本。
- 模型:
deepseek-v4-flash,通过 OpenAI-compatible 网关调用。 - 本地前端有一处功能补丁:
frontend/src/utils/request.ts的postUpload()默认超时增加为600000ms,用于文件上传;随后重新构建前端。没有修改聊天流处理、AgentStreamDisplay.vue或后端ContinueStream。尚未在完全未修改的官方 UI 镜像上单独复现,因此不能把当前环境描述为原版 UI。 本次卡顿排查没有继续修改代码或服务配置。
已检索仓库中的“卡顿”相关 Issue,并查看了 #996。该报告主要讨论快问并发及模型生成 SQL 的等待;本报告提供 Wiki 问答中大量 chunk/历史 SSE 回放与临时 UI 卡顿同时出现的现场日志,暂未找到对应的同一问题报告。
Steps to Reproduce
以下是现场触发过程,不能保证每次稳定复现:
- 进入一个已有 Wiki 内容的知识库,创建新对话,选择「维基问答 / builtin-wiki-researcher」及上述模型。
- 输入「介绍一下 SpyGlass RDC 流程」这类需要综合多篇资料的提问,等待回答生成。
- 本次生成过程出现了 17 次 LLM 调用,其中连续 12 次返回
finish_reason="length",对应每次completion_tokens=4096;后续轮次继续生成。 - 生成期间日志出现 3 次同一会话、同一回答的
continue-stream请求,分别准备回放 29,068 / 32,327 / 47,196 个事件。本次未单独记录每次恢复请求由刷新、重新进入页面还是自动重连触发,不将其认定为已确认的自动重连循环。 - 用户在生成期间遇到明显页面卡顿,回答完成后表示恢复正常。完成后重新查看该会话也正常。
用于构造最小复现时,可重点验证“长回答持续输出大量 chunk + 生成中恢复流”的组合。生产知识库正文未公开,下面仅提供脱敏运行日志。
Expected Behavior
长回答生成或恢复历史流期间,页面应保持可交互。即使模型连续进行多轮生成、SSE 历史事件达到数万条,历史回放及 Markdown/DOM 更新也不应让页面出现严重卡顿。
如果连续 finish_reason="length" 后的续轮行为属于预期,也希望前端渲染与恢复机制能承受这种事件量,或有明确的限制及提示。
Actual Behavior
已确认的数据(时间均为 2026-09-17,UTC+08:00)
| 项目 | 现场记录 |
|---|---|
| 第一次 LLM round_start | 18:27:44.907 |
| Agent QA 完成 | 18:30:44.997 |
| 原始 agent-chat 请求结束 | 18:30:48.078,HTTP 200,耗时 3m3.233019279s |
| 原始请求的后端日志响应大小 | 7,408,282 bytes |
| 模型调用 | 17 次,累计 completion tokens = 54,287 |
| 连续长度截断 | 12 次,iteration 4–15,每次 completion_tokens = 4096 |
| 每轮 prompt_tokens | 从 12,137 增长到 92,949 |
| 工具调用 | 共 6 次 |
| 历史消息 | 会话加载时只有 2 条用户/助手消息;并非大量历史对话积累 |
| 页面表现 | 回答生成期间临时严重卡顿,完成后恢复;没有采集卡顿瞬间 CPU profile 或 FPS |
rounds=16 steps=17 是后端最终日志值;上表 17 次模型调用按 [LLM Usage] 条目统计。页面显示的“思考轮数”与模型调用次数不是同一口径。
流恢复请求(同一 SESSION_A / MESSAGE_A)
| 开始回放时间 | 回放事件数 | 请求结束时间 | 整个恢复请求耗时 | 后端响应大小 / 状态 |
|---|---|---|---|---|
| 18:29:27.447 | 29,068 | 18:29:36.608 | 9.286165599s | 4,498,144 bytes / 200 |
| 18:29:37.831 | 32,327 | 18:30:22.764 | 45.073743205s | 6,424,147 bytes / 200 |
| 18:30:25.969 | 47,196 | 18:30:45.023 | 19.257708247s | 7,408,282 bytes / 200 |
表中的耗时包括恢复后的继续流式等待,不是纯历史回放耗时;事件数是后端“Preparing to replay”记录,不是已测得的 DOM 渲染次数。
代码排查线索(待性能记录验证)
检查的是上述提交的代码:
frontend/src/composables/useChatStreamHandler.ts:answer chunk 追加到响应式answerEvent.content后会调用recomposeAgentAnswer(message)并更新message.content/fullContent.value。frontend/src/views/chat/components/AgentStreamDisplay.vue:存在对eventStream的深度 watch(约 1436–1494 行),其中遍历事件流并在nextTick后执行hydrateProtectedFileImages()、enhanceMarkdownContainer(),还包含滚动相关 DOM 查询/读写;另有深度 watch 检查完成状态(约 1524–1534 行)。组件也已有 typewriter/部分保护逻辑,不能简单说完全没有节流。上述工作在持续 chunk 和大批历史恢复时是否过于频繁,需要 profiling 验证,尚未测得实际执行次数。internal/handler/session/stream.go的ContinueStream:读取历史时调用GetEvents(ctx, sessionID, messageID, 0),随后循环逐个发送历史事件,再继续订阅。该路径会从起始位置回放历史,现场达到 47,196 个事件。
关键逻辑摘录:
if (data.content) {
answerEvent.content = String(answerEvent.content || '') + String(data.content)
message.content = recomposeAgentAnswer(message)
fullContent.value = String(message.content || '')
}events, currentOffset, err := h.streamManager.GetEvents(ctx, sessionID, messageID, 0)
// ...
for _, evt := range events {
emitStreamEvent(ctx, c, evt, message.RequestID, resourceRewriter)
}希望维护者重点确认:
- 大量 chunk / 历史恢复场景,事件更新及 Markdown/图片/滚动 DOM 后处理是否需要批处理、合并或减少重复扫描?
ContinueStream是否可以使用聚合快照、增量位置或事件合并,避免每次恢复从 0 逐条回放数万事件?- 连续 12 次
finish_reason="length"后继续生成、上下文持续增长是否符合预期?本次尚未确认 4096 限制具体来自模型网关还是应用配置,不把限制来源直接归因于 WeKnora。
排查范围及伴随错误
- 同一时间段的消息加载接口日志为 HTTP 200,约 2–3ms。不能据此证明整条流或浏览器执行完全正常。
- 18:32:30(卡顿恢复后)的服务器快照:load average
0.94 / 0.46 / 0.39,可用内存约 25GB,无 swap 使用;app 容器 CPU 约 0.44%、内存约 325MiB。这是事后快照,不能排除卡顿瞬间存在资源峰值。 - QA 完成后另有 chat history embedding 错误:
INVALID length=14595 (must be [1, 8192])。它发生在 18:30:45.445,暂未证实与 UI 卡顿存在因果关系,作为伴随线索保留在日志中。 - 当前没有浏览器 Performance trace/HAR;因此将“高频响应式更新 + 大量 SSE 历史回放可能放大前端开销”作为待验证假设,而不是已完成根因定位。
WeKnora Version
Backend v0.8.0; frontend built from commit 1edcd54b43606d9079bb36650efe3f68707a79ea, with the postUpload timeout patch described above.
Deployment Method
Other
Operating System
Server: Rocky Linux 9.7 x86_64 (8 vCPU / 32 GB RAM); client: Windows / Codex in-app browser.
Relevant Logs
以下为筛选后的 81 行相关运行日志。会话、消息、请求和用户标识已替换为占位符,IP、请求/响应正文及 prompt hash 已脱敏。保留原始时间、源码位置、事件数、token 数、耗时和 HTTP 状态。未包含知识库原文、模型回答正文或认证信息。
INFO [2026-09-17 18:27:44.907] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=0 max_iterations=30 message_count=2 pending_tools=21 round=1
INFO [2026-09-17 18:27:46.229] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=12137, completion_tokens=167, total_tokens=12304, cached_tokens=5760, cache_read_tokens=5760, cache_write_tokens=0, cache_miss_tokens=6377, cache_hit_rate=47.5%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:27:46.229] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-1 completed: content=135 chars, tool_calls=2, emitted_events=map[final_answer_chunk:28 thought_chunk:43 tool_call_pending:2]
INFO [2026-09-17 18:27:46.229] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=135 finish_reason="tool_calls" iteration=0 tool_calls=2
INFO [2026-09-17 18:27:46.381] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=1 max_iterations=30 message_count=5 pending_tools=21 round=2
INFO [2026-09-17 18:27:47.516] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=23126, completion_tokens=170, total_tokens=23296, cached_tokens=12288, cache_read_tokens=12288, cache_write_tokens=0, cache_miss_tokens=10838, cache_hit_rate=53.1%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:27:47.516] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-2 completed: content=62 chars, tool_calls=1, emitted_events=map[final_answer_chunk:15 thought_chunk:72 tool_call_pending:1]
INFO [2026-09-17 18:27:47.516] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=62 finish_reason="tool_calls" iteration=1 tool_calls=1
INFO [2026-09-17 18:27:47.624] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=2 max_iterations=30 message_count=8 pending_tools=21 round=3
INFO [2026-09-17 18:27:49.768] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=31872, completion_tokens=413, total_tokens=32285, cached_tokens=23296, cache_read_tokens=23296, cache_write_tokens=0, cache_miss_tokens=8576, cache_hit_rate=73.1%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:27:49.769] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-3 completed: content=78 chars, tool_calls=2, emitted_events=map[final_answer_chunk:17 thought_chunk:208 tool_call_pending:2]
INFO [2026-09-17 18:27:49.769] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=78 finish_reason="tool_calls" iteration=2 tool_calls=2
INFO [2026-09-17 18:27:49.896] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=3 max_iterations=30 message_count=11 pending_tools=21 round=4
INFO [2026-09-17 18:27:51.708] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=43222, completion_tokens=338, total_tokens=43560, cached_tokens=32256, cache_read_tokens=32256, cache_write_tokens=0, cache_miss_tokens=10966, cache_hit_rate=74.6%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:27:51.708] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-4 completed: content=117 chars, tool_calls=1, emitted_events=map[final_answer_chunk:21 thought_chunk:218 tool_call_pending:1]
INFO [2026-09-17 18:27:51.708] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=117 finish_reason="tool_calls" iteration=3 tool_calls=1
INFO [2026-09-17 18:27:51.824] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=4 max_iterations=30 message_count=13 pending_tools=21 round=5
INFO [2026-09-17 18:28:07.653] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=47863, completion_tokens=4096, total_tokens=51959, cached_tokens=43520, cache_read_tokens=43520, cache_write_tokens=0, cache_miss_tokens=4343, cache_hit_rate=90.9%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:28:07.654] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-5 completed: content=13440 chars, tool_calls=0, emitted_events=map[final_answer_chunk:3678 thought_chunk:357]
INFO [2026-09-17 18:28:07.654] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=13440 finish_reason="length" iteration=4 tool_calls=0
INFO [2026-09-17 18:28:07.786] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=5 max_iterations=30 message_count=14 pending_tools=21 round=6
INFO [2026-09-17 18:28:22.229] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=51962, completion_tokens=4096, total_tokens=56058, cached_tokens=51712, cache_read_tokens=51712, cache_write_tokens=0, cache_miss_tokens=250, cache_hit_rate=99.5%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:28:22.230] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-6 completed: content=9311 chars, tool_calls=0, emitted_events=map[final_answer_chunk:2514 thought_chunk:1550]
INFO [2026-09-17 18:28:22.230] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=9311 finish_reason="length" iteration=5 tool_calls=0
INFO [2026-09-17 18:28:22.348] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=6 max_iterations=30 message_count=15 pending_tools=21 round=7
INFO [2026-09-17 18:28:35.858] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=54487, completion_tokens=4096, total_tokens=58583, cached_tokens=51840, cache_read_tokens=51840, cache_write_tokens=0, cache_miss_tokens=2647, cache_hit_rate=95.1%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:28:35.858] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-7 completed: content=14496 chars, tool_calls=0, emitted_events=map[final_answer_chunk:3952 thought_chunk:107]
INFO [2026-09-17 18:28:35.858] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=14496 finish_reason="length" iteration=6 tool_calls=0
INFO [2026-09-17 18:28:35.986] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=7 max_iterations=30 message_count=16 pending_tools=21 round=8
INFO [2026-09-17 18:28:48.945] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=58463, completion_tokens=4096, total_tokens=62559, cached_tokens=54400, cache_read_tokens=54400, cache_write_tokens=0, cache_miss_tokens=4063, cache_hit_rate=93.1%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:28:48.946] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-8 completed: content=14402 chars, tool_calls=0, emitted_events=map[final_answer_chunk:3931 thought_chunk:129]
INFO [2026-09-17 18:28:48.946] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=14402 finish_reason="length" iteration=7 tool_calls=0
INFO [2026-09-17 18:28:49.112] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=8 max_iterations=30 message_count=17 pending_tools=21 round=9
INFO [2026-09-17 18:29:01.830] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=62416, completion_tokens=4096, total_tokens=66512, cached_tokens=58368, cache_read_tokens=58368, cache_write_tokens=0, cache_miss_tokens=4048, cache_hit_rate=93.5%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:29:01.831] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-9 completed: content=14869 chars, tool_calls=0, emitted_events=map[final_answer_chunk:4042 thought_chunk:31]
INFO [2026-09-17 18:29:01.831] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=14869 finish_reason="length" iteration=8 tool_calls=0
INFO [2026-09-17 18:29:02.010] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=9 max_iterations=30 message_count=18 pending_tools=21 round=10
INFO [2026-09-17 18:29:14.623] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=66482, completion_tokens=4096, total_tokens=70578, cached_tokens=62336, cache_read_tokens=62336, cache_write_tokens=0, cache_miss_tokens=4146, cache_hit_rate=93.8%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:29:14.624] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-10 completed: content=12822 chars, tool_calls=0, emitted_events=map[final_answer_chunk:3557 thought_chunk:506]
INFO [2026-09-17 18:29:14.624] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=12822 finish_reason="length" iteration=9 tool_calls=0
INFO [2026-09-17 18:29:14.799] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=10 max_iterations=30 message_count=19 pending_tools=21 round=11
INFO [2026-09-17 18:29:27.271] [LOAD_1 client_ip=<CLIENT_IP> latency=2.96126ms method=GET path=/api/v1/messages/SESSION_A/load?limit=20 response_body=<OMITTED> size=806 status_code=200] |
INFO [2026-09-17 18:29:27.350] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=70058, completion_tokens=4096, total_tokens=74154, cached_tokens=66432, cache_read_tokens=66432, cache_write_tokens=0, cache_miss_tokens=3626, cache_hit_rate=94.8%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:29:27.350] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-11 completed: content=14818 chars, tool_calls=0, emitted_events=map[final_answer_chunk:4037 thought_chunk:36]
INFO [2026-09-17 18:29:27.350] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=14818 finish_reason="length" iteration=10 tool_calls=0
INFO [2026-09-17 18:29:27.447] [STREAM_1] stream.go:132[ContinueStream] | Preparing to replay 29068 events and continue streaming, session ID: SESSION_A, message ID: MESSAGE_A
INFO [2026-09-17 18:29:27.526] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=11 max_iterations=30 message_count=20 pending_tools=21 round=12
INFO [2026-09-17 18:29:36.608] [STREAM_1 client_ip=<CLIENT_IP> latency=9.286165599s method=GET path=/api/v1/sessions/continue-stream/SESSION_A?message_id=MESSAGE_A response_body=<OMITTED> size=4498144 status_code=200] |
INFO [2026-09-17 18:29:37.601] [LOAD_2 client_ip=<CLIENT_IP> latency=2.353186ms method=GET path=/api/v1/messages/SESSION_A/load?limit=20 response_body=<OMITTED> size=806 status_code=200] |
INFO [2026-09-17 18:29:37.831] [STREAM_2] stream.go:132[ContinueStream] | Preparing to replay 32327 events and continue streaming, session ID: SESSION_A, message ID: MESSAGE_A
INFO [2026-09-17 18:29:40.115] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=74118, completion_tokens=4096, total_tokens=78214, cached_tokens=70016, cache_read_tokens=70016, cache_write_tokens=0, cache_miss_tokens=4102, cache_hit_rate=94.5%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:29:40.116] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-12 completed: content=14750 chars, tool_calls=0, emitted_events=map[final_answer_chunk:4019 thought_chunk:54]
INFO [2026-09-17 18:29:40.116] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=14750 finish_reason="length" iteration=11 tool_calls=0
INFO [2026-09-17 18:29:40.295] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=12 max_iterations=30 message_count=21 pending_tools=21 round=13
INFO [2026-09-17 18:29:53.029] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=78161, completion_tokens=4096, total_tokens=82257, cached_tokens=74112, cache_read_tokens=74112, cache_write_tokens=0, cache_miss_tokens=4049, cache_hit_rate=94.8%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:29:53.031] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-13 completed: content=11764 chars, tool_calls=0, emitted_events=map[final_answer_chunk:3263 thought_chunk:808]
INFO [2026-09-17 18:29:53.031] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_len=11764 finish_reason="length" iteration=12 tool_calls=0
INFO [2026-09-17 18:29:53.217] [REQUEST_A] | [PIPELINE] stage=Agent action=round_start iteration=13 max_iterations=30 message_count=22 pending_tools=21 round=14
INFO [2026-09-17 18:30:05.793] [REQUEST_A] usage.go:19[logUsage] | [LLM Usage] model=deepseek-v4-flash, purpose=agent_round, prompt_prefix=<HASH> prompt_tokens=81434, completion_tokens=4096, total_tokens=85530, cached_tokens=78080, cache_read_tokens=78080, cache_write_tokens=0, cache_miss_tokens=3354, cache_hit_rate=95.9%, cache_reported=true, cache_status=hit, session_id=SESSION_A, principal=<USER>
INFO [2026-09-17 18:30:05.793] [REQUEST_A] think.go:444[streamThinkingToEventBus] | [Agent][Thinking] Iteration-14 completed: content=14742 chars, tool_calls=0, emitted_events=map[final_answer_chunk:4019 thought_chunk:54]
INFO [2026-09-17 18:30:05.793] [REQUEST_A] | [PIPELINE] stage=Agent action=think_result content_lenSource: Tencent/WeKnora