desktop: Go provider not grouped under the Console account header in the model picker

オープン 初心者向け
#68,121 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
frontend

調査の方向性

まずデスクトップアプリで consoleProviderGroup と pickerSections を見つけ、プロバイダー名によって管理対象のグループと Go バッジがどのように決まるかを追ってください。レポートには具体的な再現手順があり、opencode-go を除外する名前のプレフィックス判定が特定されています。近くにあるモデルピッカーのテストを確認し、このケースのカバレッジを追加または更新してください。Go プロバイダーがバッジと使用量メーターとともに Console ワークスペースのヘッダーの下に表示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area/desktop inference/go platform/macos type/bug version/v2

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

  1. 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.
  2. Open the model picker (the composer's model button, or Cmd+').
  3. Compare the OpenCode Go section with the OpenCode section 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 Go as a plain provider section at the top, with no account header, no Go badge 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% used in 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-go is 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 Go badge is gated on the workspace group containing opencode-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 OpenCode section 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時間
マージ済み PR(30日)
528

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。