fix(runtime): keep unpriced turns distinguishable from free ones after reload
维护者通常 1 天内回复
@dgageot 已经在做这个了。
开始于 2026年10月21日。
评估
这个 Issue 还没有评估数据。
描述
Problem
When a model has no known price (not in the models.dev catalogue and no cost: override), the runtime records the turn's cost as $0, with a warning (loop.go). chat.Message.Cost and the compaction item's Cost are plain float64, so the distinction is lost on save.
In memory, hooks, telemetry and the budget tracker already tell the two apart: nil means unpriced, 0 means free (BudgetUsageEvent.Unpriced). After a session is saved and reloaded, every unpriced turn reads as free, and session totals understate the real cost without saying so.
Proposal
- Persist whether a message's (and a compaction item's) cost is known, additively, e.g. an
unpricedflag next tocostin the stored JSON. - Surface it in session totals and the API: "$1.23 + unpriced turns" rather than "$1.23".
- Keep old sessions readable; their missing flag means "priced".
Acceptance criteria
- An unpriced turn stays unpriced after a SQLite save and reload, and a free one (
cost: {}) stays free. - Session totals and the API distinguish them.
- Old sessions load unchanged.
Found while planning #4654.
- 主要语言
- Go
- 星标
- 4.7k
- 派生
- 565
- 平均合并
- 18 小时 52 分钟
- 30 天内合并 PR
- 221
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/docker-agent 的其他 Issue
-
edit_file diff rendering panics on invalid UTF-8 text可能已有人在做 @TDnorthgarden 今天认领。 未关闭area/tui
难度 2/5 1-3 小时 新手友好度 85/100
docker/docker-agent#4955 ·
维护者通常 1 天内回复
-
A setting to turn off the models.dev catalog download (offline and strict-network use)可能已有人在做 @3431481073 于 19 天前认领。 未关闭area/config area/models
难度 2/5 1-3 小时 新手友好度 72/100
docker/docker-agent#4714 ·
维护者通常 1 天内回复
-
Error when trying to run sandbox example?可能重新可做 @dgageot 于 28 天前认领,目前没有进行中的 PR。 未关闭area/cli
难度 2/5 1-3 小时 新手友好度 62/100
docker/docker-agent#4672 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
`edit_file` silently edits the first match when `oldText` occurs more than once可能已有人在做 @dwin-gharibi 于 103 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 78/100
docker/docker-agent#3929 · 2 条评论 ·
维护者通常 1 天内回复
-
area/api area/runtime
难度 4/5 3-5 天 新手友好度 48/100
docker/docker-agent#4951 ·
维护者通常 1 天内回复
查看 docker/docker-agent 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
fluxcd/notification-controller#1441 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
volcengine/volcengine-go-sdk#163 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
OneBusAway/maglev#2145 ·
维护者通常 2 天内回复
-
priority/medium status/ready type/chore
难度 2/5 1-3 小时 新手友好度 84/100
discobox-ai/discobox#1357 ·
维护者通常 1 天内回复