claude-agent with a Claude subscription doesn't set cache.ttl, so warming pings every 4 minutes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend
调研方向
从 claude-agent provider 中的 priceSource() 开始,它已经会检测登录是否为订阅,并跟踪每个模型的 settings 对象如何组装,以便订阅登录时可以将 cache.ttl 设为 1h。然后检查当 cache.ttl 缺失时会回退到 4 分钟的 warming 间隔逻辑。完成状态是:在订阅登录下,每个 claude-agent 模型上的 GET /api/model 都返回 settings.cache.ttl,且 warming keep-alive 间隔为一小时。
由索引模型根据 Issue 内容生成。
描述
Description
With claude-agent signed in through a Claude subscription, the prompt cache lasts an hour, but none of its models have settings.cache.ttl. So warming's "auto" interval falls back to 4 minutes: about a dozen keep-alive requests an hour instead of one, each sending the full context and using up subscription quota. Background compaction is hit the same way: once a session has been idle for 5 minutes it no longer precomputes the summary, even though the cache is still there.
The workaround is adding "settings": { "cache": { "ttl": "1h" } } to every claude-agent model in the config. priceSource() in the claude-agent provider already knows when the login is a subscription, so it could set cache.ttl there.
Plugins
None
OpenCode version
2.3.2
Steps to reproduce
- Sign in to claude-agent with a Claude subscription
- Set
"warming": truein the config GET /api/model: none of the claude-agent models havesettings.cache.ttl
Screenshot
No response
Operating System
Windows 11
Terminal
OpenChamber desktop app
- 主要语言
- TypeScript
- 星标
- 228k
- 派生
- 31k
- 平均合并
- 3 小时 22 分钟
- 30 天内合并 PR
- 476
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
desktop: app-version.v1 in drafts.sqlite is never refreshed — reports 1.19.4 while running 2.3.2未关闭area/desktop platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 66/100
anomalyco/opencode#66079 · 1 条评论 ·
维护者通常 1 天内回复
-
area/mcp platform/windows status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66073 · 1 条评论 ·
维护者通常 1 天内回复
-
area/mcp platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#65997 · 1 条评论 ·
维护者通常 1 天内回复
-
@opencode/ui: v2-text-text-faint and light v2-state-fg-warning fall below WCAG AA 4.5:1 contrast可能已有人在做 @KhadeerBasha1232 今天认领。 未关闭status/repro-plausible
难度 2/5 1-3 小时 新手友好度 75/100
anomalyco/opencode#65923 · 2 条评论 ·
维护者通常 1 天内回复
-
area/core platform/windows type/bug version/v2
难度 2/5 1-3 小时 新手友好度 80/100
anomalyco/opencode#65880 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
lidofinance/validator-ejector#233 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
ai-driven-qa bug claude Major
难度 2/5 1-3 小时 新手友好度 78/100
linagora/twake-mail-admin#742 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
OpenSlides/openslides-client#6728 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 66/100