Windows: global-project session path depends on server process drive, hides API-created sessions from desktop picker
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/opencode/src/session/session.ts の sessionPath を読み、その後 packages/tui/src/context/sync.tsx の sessionListQuery() と、issue に記載されたパスのマッチングを確認してください。別の Windows ドライブで作成された global-project セッションが同じパス表記を使用し、デスクトップの /sessions ピッカーに表示されることを検証してください。利用可能であれば、関連する session および TUI のチェックを追加または実行してください。
索引モデルが issue の本文から書いたものです。
説明
Problem
Sessions created through opencode web (or any API client) on Windows are invisible in the desktop TUI /sessions picker when the target directory is on a different drive than the server process's cwd — as long as the directory has no git repo (so the session lands in the global project).
Concrete case (v1.18.32, single shared opencode.db):
opencode webruns with cwd onC:.- Phone app creates a session with
directory=D:\Work\ForAI\dsh-plugin-TTS, sends messages. The session is fully readable viaGET /sessionandGET /session?directory=.... - Desktop TUI opened in
D:\Work\ForAI\dsh-plugin-TTSshows only an older session in its picker, never the new ones.
Root cause
packages/opencode/src/session/session.ts:
sessionPath(worktree, cwd)=relative(resolve(worktree), cwd). Forglobal-project sessions the worktree is/, and on Windowsresolve("/")is the server process's drive root. Same directory string therefore stores a differentpathdepending on who created it:- web on
C:→path = "D:/Work/ForAI/dsh-plugin-TTS"(absolute, cross-drive fallback) - TUI on
D:→path = "Work/ForAI/dsh-plugin-TTS"(relative)
- web on
- The TUI picker (
packages/tui/src/context/sync.tsx→sessionListQuery()) queriessession.list({ path })with its own drive-relative spelling, andlistByProjectmatchespathverbatim (eq/LIKE path/%). The two spellings never match, so each side only ever sees sessions minted on its own drive.
Verified locally: GET /session?path=Work/ForAI/dsh-plugin-TTS&roots=true returns exactly the 1 old session; the same query with the absolute spelling returns exactly the 2 missing ones.
Side note explaining a related asymmetry: a phone app that lists sessions globally (no project_id/path filter) sees desktop-created sessions fine — the filtering only bites in the desktop picker direction. Also note git init does NOT help here: it moves the TUI query to a new project id while existing sessions stay global, hiding even more.
Suggested fix
In sessionPath, when the worktree is the global root ("/") and the session directory is a Windows drive-absolute path, anchor the relative computation at the session directory's own drive root (D:/) instead of the server process drive. That makes the stored path identical no matter which drive the server runs on, and identical to what a same-drive TUI queries. It is a no-op for same-drive sessions and for real (git) worktrees.
I can put up a PR for this if the approach sounds right.
- 主要言語
- TypeScript
- スター
- 210k
- フォーク
- 27.8k
- 平均マージ
- 6時間 50分
- マージ済み PR(30日)
- 336
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
anomalyco/opencode#51159 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
inu-appcenter/memorIN-frontend#106 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 7 日以内に返信
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
CSCfi/sd-search-ui#145 ·
メンテナーはふだん 1 日以内に返信
-
Add: Cbeebies pl SDオープンcheck:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信