desktop: Go provider not grouped under the Console account header in the model picker
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
首先在桌面应用中找到 consoleProviderGroup 和 pickerSections,然后追踪提供商名称如何决定受管理的分组和 Go 徽标。报告给出了具体的复现步骤,并指出排除 opencode-go 的名称前缀检查;检查附近的模型选择器测试,并为此情况添加或更新覆盖。Go 提供商显示在 Console 工作区标题下方,并带有徽标和用量计量器时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
In the desktop app, when signed in to an OpenCode Console account with a Go subscription, the model picker does not group the Go provider under the Console account header. Go models stay in their own OpenCode Go section, the account header and Go usage meter render above the separate OpenCode (paid) section instead, and the header has no Go badge.
Environment
- opencode version: 2.4.4 (latest release at the time of writing)
- Client: desktop (macOS app, sidecar server)
- Model and provider:
opencode-go/*(e.g.opencode-go/deepseek-v4.1-flash) - OS: Darwin 27.2.0 (darwin arm64)
- Terminal: Not relevant (desktop app)
- Shell:
/opt/homebrew/bin/fish - Install/channel: release, latest
- Active plugins: none relevant (reproduces with the built-in set)
Reproduction
- In the desktop app, sign in to OpenCode Console with Sign in with OpenCode (device flow) to an account whose workspace has a Go subscription. Do not use an API key.
- Open the model picker (the composer's model button, or
Cmd+'). - Compare the
OpenCode Gosection with theOpenCodesection below it.
Expected Behavior
Per the v2.4.4 changelog (model picker account header work), the picker should show one OpenCode header for the active Console workspace with the account, a Go badge and the Go usage meter; the workspace's paid models should sit under that header, followed by a Go sub-heading and then the workspace's other providers.
Actual Behavior
The picker renders:
OpenCode Goas a plain provider section at the top, with no account header, noGobadge and no usage meter;OpenCode(paid Console models) as a second section below it, and only there does the account header appear — account name, chevron, and the Go usage meter (5% usedin my case, opening to 5-hour / weekly / monthly windows).
So the account switcher and usage meter work, but they are attached to the wrong section, and the Go badge never appears.
Additional Context
Both providers come from the server with the same integration and the same workspace headers, so the credential and workspace are correct — only the grouping fails:
$ GET /api/provider?location[directory]=<dir>
{ "id": "opencode", "integrationID": "opencode",
"name": "Default / OpenCode", "activation": "enabled",
"headers": { "x-opencode-org-id": "wrk_<redacted>" } }
{ "id": "opencode-go", "integrationID": "opencode",
"name": "OpenCode Go", "activation": "enabled",
"headers": { "x-opencode-org-id": "wrk_<redacted>" } }
The grouping helper in the desktop app only folds providers whose display name carries the workspace prefix:
export function consoleProviderGroup<T extends Provider>(providers: readonly T[]) {
const root = providers.find((provider) => provider.id === "opencode" && provider.integrationID === "opencode")
const suffix = " / OpenCode"
if (!root?.name.endsWith(suffix)) return
const workspace = root.name.slice(0, -suffix.length).trim()
if (!workspace) return
const prefix = `${workspace} / `
return {
root,
workspace,
prefix,
providers: providers.filter(
(provider) => provider.integrationID === "opencode" && provider.name.startsWith(prefix),
),
}
}
With the names above, workspace = "Default", prefix = "Default / ", and opencode-go ("OpenCode Go") fails startsWith(prefix). Consequently:
opencode-gois not in the managed set, so its section is rendered as a plain provider group (pickerSections,if (!managed.has(group.category)) return [{ key: group.category, items }]);- the
Gobadge is gated on the workspace group containingopencode-go(go = !!labels.group()?.providers.some((p) => p.id === "opencode-go")), so it is false; - the usage meter itself is gated only on the existence of Go usage data, which is why it renders correctly — just under the
OpenCodesection instead of heading both.
Side evidence that usage data is present and correct: GET /api/experimental/usage/limits returns the workspace and go: { rolling, weekly, monthly } for the signed-in location.
Possibly the Console catalog should name the Go provider <workspace> / OpenCode Go, or consoleProviderGroup should also match providers whose name is the suffix itself (or match by integration + workspace headers) rather than relying on the display-name prefix.
Screenshots (picker, and the usage meter popover with 5-hour 0%, weekly 5%, monthly 2%) can be attached on request.
- 主要语言
- 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/providers inference/free-tier inference/go platform/windows status/repro-plausible type/bug version/v2
难度 2/5 1-3 小时 新手友好度 76/100
anomalyco/opencode#68063 · 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 天内回复