tui: /models drops provider grouping when the session location differs from the default location

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

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

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

  • #62109 @andycostintoma による — マージされずにクローズ

評価

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

調査の方向性

まず packages/tui/src/component/use-connected.tsx を確認し、issue によると location.ref を渡すモデルおよびインテグレーションのダイアログと、位置情報の検索方法を比較します。LocationProvider がアクティブな位置情報をどのように同期するかを確認し、デフォルトとは異なるディレクトリにあるセッションで再現します。そのセッションの接続済みプロバイダーとそのグループが /models に表示されれば完了です。issue にはテストファイルの指定はありません。

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

説明

reproduced
Description

When the TUI opens a session whose directory is not the client's default location, /models shows one flat list without provider groups, Favorites or Recent, and its action reads "View all integrations" as if nothing were connected. The integrations dialog in the same session shows the providers as connected.

useConnected() in packages/tui/src/component/use-connected.tsx calls data.location.integration.list() without a location, so it reads the default location's store. LocationProvider only syncs the active location, so when the two differ that store stays empty and useConnected() returns false. The model dialog and the integrations dialog already pass the active location (location.ref); useConnected() doesn't.

I hit it with --server against a remote service: the client's cwd doesn't exist on the server, so the default location falls back to the server's cwd while the session lives in a project directory. The same happens locally with -s <session> for a session in another directory.

Plugins

None needed to reproduce.

OpenCode version

2.2.1 (still present on dev)

Steps to reproduce
  1. Connect any provider, e.g. Anthropic.
  2. Start the service from one directory (cd ~ && opencode service start).
  3. Create a session in a different directory via POST /api/session with {"location":{"directory":"/path/to/project"}}.
  4. From a directory that isn't that project (or from another machine with --server), run opencode -s <session-id>.
  5. Open /models: flat list, "View all integrations". Open the integrations dialog: providers show as connected.
Screenshot

Not attached; /models renders a single flat list with "View all integrations" as its action.

Operating System

Linux (NixOS / Ubuntu)

Terminal

Reproduces independent of terminal (state bug, not rendering).

主要言語
TypeScript
スター
224k
フォーク
30k
平均マージ
5時間 25分
マージ済み PR(30日)
494

環境構築

はじめの一歩

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

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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