Commit Graph
6 Commits
Author SHA1 Message Date
Autumn-27 9103ff838a feat(llmrec): 录制请求体补记实际发出的思考参数
Recorder 携带配置级 thinking_type/reasoning_effort(这些在 norma buildBody 里从
provider 配置注入 HTTP body,不在 CompletionRequest 上,故录制原先完全看不到)。
序列化时写入 thinking:{type,effort},type 取有效值——每请求 req.Thinking 覆盖优先
于配置级(如 compaction 摘要强制 disabled),与 buildBody 判定一致。前端录制查看页
原样美化 JSON,自动展示该字段。

Claude-Session: https://claude.ai/code/session_01Bs2rrsVHUBTxRusm9espwB
2026-08-20 12:35:12 -04:00
Autumn-27 def7649baa feat(tokens): 新增 llm_usage 计量账本,按模型统计 token + 仪表盘新旧版切换
- llmrec: 拆分轻量计量与重量 body 录制——token+model+task+worker 永远写入
  新表 llm_usage(不含 body,不受 llm_record 开关控制),body 仍受开关控制
- 修复 token 累加 bug:usage 从覆盖改为 Add(Anthropic 把 input/output 拆到
  message_start/message_delta 两个事件,覆盖会把 input 冲成 0;OpenAI 不受影响)
- 任务总览新增「LLM Token 用量」卡片:按模型统计 + 缓存命中率(缓存读/输入)
- 仪表盘 Token 卡片加「新版/旧版」开关:新版走 llm_usage(逐次精确、含中断消耗、
  真实每日消耗),旧版沿用 activity 统计
- llm_usage 随任务删除保留(历史计量账本)

Claude-Session: https://claude.ai/code/session_014TfZWeVGhjXqZD3vcj44mz
2026-08-20 11:16:48 -04:00
pphua 9793b522d9 feat(tasks): add inherited context and resilient LLM execution
Add read-only task context inheritance, ordered task-level LLM failover, live Worker controls, cascading task cleanup, FIFO task concurrency, cancellation diagnostics, UI updates, tests, build script, and changelog.
2026-08-20 18:34:24 +08:00
Autumn-27andClaude Opus 4.8 ad9f14f140 feat: LLM 录制开关、模型列表第三方回退、命令页改为工具执行
在 review PR5 基础上的三处改进:

1. LLM 录制开关(默认关,settings.llm_record)
   - 录制页数据大小下拉框旁加开关;关闭时 Recorder.Stream 直接透传,
     不序列化、不累积、不写库,零开销。切换即时生效,无需重建 agent。

2. 模型列表拉取支持 Anthropic 兼容第三方
   - pgListModels 改为按序尝试多个候选端点:anthropic 的 /v1/models 拿不到时,
     剥掉 /anthropic 回退到 OpenAI 式 /models(自动切 Bearer 头)。
     修复 DeepSeek(anthropic) 加载模型 404。

3. 命令页改为「工具执行」列表
   - ListCommands 去掉 tool='Bash' 过滤,覆盖所有 tool_use;返回工具名列,
     搜索匹配工具名或参数。前端加「工具」列、标题/侧边栏改为「工具执行」。

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-07 09:32:01 -04:00
Autumn-27andClaude Opus 4.8 10f891a21d fix(llmrec): 从 ctx 读取 session,修复 task/worker 列为空
原实现依赖 SetSession() 写入共享的 sessionID 字段,但该方法从未被调用,
导致 session/task/worker 恒为空、落库为 NULL,前端两列无数据。且共享可变字段
在 planner 与多 worker 并发调用同一 Recorder 时会互相覆盖、串号。

norma 已通过 transcript.WithSessionID 把 session 注入 ctx(格式 exp<N>-<role>),
改为在 Stream 中按 ctx 逐调用读取,天然 per-call、无竞争。删除未使用的
SetSession/getContext 及共享字段。

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-07 08:52:24 -04:00
lornlee 5b58330f01 feat: 添加LLM模型清单、命令执行记录录制和LLM请求记录录制功能 2026-07-30 15:18:40 +08:00