desktop: Go usage meter missing when the opencode group has only free models
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
从负责对 workspace 提供方分组并呈现组标题的模型选择器代码入手;issue 指出了 workspace 名称前缀检查以及标题条件 workspace: "lead"。追踪当 opencode 没有付费模型时 opencode-go 如何分类,然后检查模型选择器的测试,或为该情况添加测试覆盖。完成标准是:即使只有免费的 opencode 模型,也会显示 Go 账户标题和用量计量器;报告中的重试行为属于单独的 follow-up。
由索引模型根据 Issue 内容生成。
描述
Summary
On desktop 2.4.4, the OpenCode Go usage meter added to the model picker is not rendered for a Go-only workspace. The meter is attached to the opencode (Console) workspace group header, but that group is dropped when it contains only free models, which are moved to the separate Free section. The opencode-go group then appears as a plain OpenCode Go label with no account or usage meter.
Environment
- opencode version: 2.4.4 (desktop; the npm CLI on PATH is 1.19.6)
- Client: desktop app, Windows
- Model and provider:
opencode-go/deepseek-v4.1-flash - OS: Windows 11, 10.0.26300 x64
- Terminal: Not applicable (desktop app)
- Shell:
cmd.exe - Install/channel: desktop stable, latest (
v2.4.4, 2026-12-03) - Active plugins: none found; MCP servers
browseandopencode_console
Reproduction
- Sign in to an OpenCode Console workspace with an active Go subscription.
- Use a workspace whose managed config disables the paid
opencodemodels. In this case all 100opencodemodels are disabled; only free models such asdeepseek-v4.1-flash-freeandhy4-flash-freeremain. - Open the desktop model picker (click the current model name in the composer).
- Observe the OpenCode section.
Expected Behavior
The picker shows the OpenCode account header with the Go badge and the 5-hour/weekly/monthly usage meter, as described in the 2.4.4 release notes ("a Go usage meter" in the model picker), even when the paid opencode group is empty.
Actual Behavior
No OpenCode account/usage header is rendered. The picker shows a plain OpenCode Go group label followed by the Go models. The free opencode models appear under Recent/Free. GET /api/experimental/usage/limits returns valid go data for the workspace (rolling/weekly/monthly), so the data is available; only the header is missing from the UI.
Adding this to the user config makes the meter appear (replace <workspace> with the workspace name):
"providers": {
"opencode-go": {
"name": "<workspace> / OpenCode Go"
}
}
The cause is that the picker builds the workspace provider set from providers whose name starts with <workspace> / . Here opencode is named <workspace> / OpenCode, while opencode-go is named just OpenCode Go, so it is not included. The Go meter is only rendered in the header of the group with workspace: "lead"; with the opencode group empty and opencode-go not recognized, no header is rendered.
Additional Context
/api/configmanaged document:opencodehas 100 disabled models;opencode-gohas 0 disabled./api/provider:opencodename<workspace> / OpenCode;opencode-gonameOpenCode Go.- The model picker groups workspace providers only when their name starts with the workspace prefix;
opencode-godoes not, so it gets a normal group header. - Secondary issue: after a transient
GET /api/experimental/usage/limits503 caused by DNS failure (getaddrinfo ENOTFOUND opencode.ai), the meter stayed hidden after the endpoint recovered; it only returned after an app restart. A retry on failure would help. - Related: #66849 (added the Go meter), #66829 (open draft for a dedicated Go settings page).
- Frequent: reproducible consistently for this workspace; the name override is the current workaround.
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 6 小时
- 30 天内合并 PR
- 528
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/web platform/windows type/bug version/v2
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#68237 · 1 条评论 ·
维护者通常 1 天内回复
-
Sidebar width未关闭area/desktop triaging type/bug
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#68206 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop inference/go platform/macos type/bug version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#68121 · 1 条评论 ·
维护者通常 1 天内回复
-
area/core platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 67/100
anomalyco/opencode#68036 · 1 条评论 ·
维护者通常 1 天内回复
-
area/web platform/android platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 70/100
anomalyco/opencode#67835 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
Chocobozzz/PeerTube#7901 ·
维护者通常 3 天内回复
-
area:tools bug has repro
难度 2/5 1-3 小时 新手友好度 86/100
anthropics/claude-code#113984 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
ehmpathy/declapract-typescript-ehmpathy#960 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 78/100
laststance/design-world#34 ·
维护者通常 1 天内回复