v2: sessions with path=NULL (around v1's add_session_path schema change) are missing from project session lists
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/core/src/session/store.ts の108行目付近から始め、プロジェクトスコープのフィルターを packages/opencode/src/session/session.ts の970-976行目付近と比較してください。SessionStore.list がルートサブパスをどのように処理するかを確認し、path IS NULL である行に対してクエリを再現してください。正しく帰属されたルートセッションがプロジェクト一覧に表示され、すべてのプロジェクトに対する動作が変更されていなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
Sessions with path = NULL are missing from project session lists after the v1→v2 upgrade, even though their project_id is correct.
v1 began with no path column; 20260428004200_add_session_path added it (default NULL), and v1's inserts still left it NULL for root-level sessions for a while (in our DB: a clean NULL window 2026-04-03→05-05, with every later session writing ''). The v1→v2 importer copies path verbatim, so these rows arrive in session_v2 with path IS NULL. The project-scoped picker sends {project, subpath: ''} and SessionStore.list filters with an exact eq(SessionTable.path, input.subpath) (packages/core/src/session/store.ts:108) — in SQL, NULL = '' is not true, so the rows are excluded. The projector only rewrites the path of the session that triggered a Resolved event; historical rows are never backfilled.
Scope in our DB (opencode 2.0.14, upgraded from 1.18.x): 90 sessions — 88 in one git repo (87 top-level, mostly user-initiated forks, ~1,300 messages total) + 2 in a second repo. All have directory = project.worktree, so the correct value is ''. They are only reachable via "all projects" scope / global search.
This is a different defect from #50980 (where the row is absent from session_v2 entirely) and from the project_id='global' family (#50551, #50800, #50999): here the project attribution is right, only path is null.
Plugins
None relevant (server-side data/filter behavior).
OpenCode version
2.0.14 (affected, by source comparison: 2.0.14–2.0.16; not fixed on latest tag)
Steps to reproduce
- In opencode v1, create sessions in a git repo root during the window where v1 didn't write
path(around the20260428004200_add_session_pathchange — e.g. after thepathcolumn exists but before v1 started writing''). - Upgrade to v2.0.14–2.0.16 and open that repo. The import copies
path = NULLintosession_v2. - List sessions in the project: the NULL-path sessions don't appear, though "all projects" scope shows them.
Check your own DB:
SELECT project_id, directory, COUNT(*) FROM session_v2 WHERE path IS NULL GROUP BY 1, 2;
Expected Behavior
Sessions whose directory equals the project worktree should be listed at subpath = '', i.e. NULL should be treated as the empty path (the dev branch already adds this: and(isNull(path), eq(directory, …)) at packages/opencode/src/session/session.ts:970-976).
Related issues
- #35750 — v1-era: new
pathcolumn not back-filled during migration (origin of these NULLs) - #50980 — sister symptom: v1-era session missing from
session_v2entirely - #50551 — the
project_id='global'family (different root cause, same picker filter)
Operating System
Arch Linux, x86_64
Terminal
kitty
- 主要言語
- TypeScript
- スター
- 210k
- フォーク
- 27.8k
- 平均マージ
- 8時間 1分
- マージ済み PR(30日)
- 357
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 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時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
melgarafael/DeskcommCRM#1812 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
prisma/prisma-cli#309 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gregwebs/pi-quota-dispatcher#26 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
openwatersio/slackwater.xyz#124 ·
メンテナーはふだん 1 日以内に返信
-
agent-reported area/browser area/docs documentation good first issue hacktoberfest help wanted P2
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 2 日以内に返信