Windows: global-project session path depends on server process drive, hides API-created sessions from desktop picker
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Leggi sessionPath in packages/opencode/src/session/session.ts, quindi ispeziona sessionListQuery() in packages/tui/src/context/sync.tsx e la corrispondenza dei percorsi descritta nell’issue. Verifica che le sessioni global-project create su un’altra unità Windows usino la stessa rappresentazione del percorso e compaiano nel selettore /sessions desktop; aggiungi o esegui i controlli session e TUI pertinenti, se disponibili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 210k
- Fork
- 27.8k
- Merge medio
- 8h 43m
- PR unite (30g)
- 380
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di anomalyco/opencode
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
anomalyco/opencode#51159 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di anomalyco/opencode
Issue simili
-
docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
remix-run/react-router#15558 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
solana-foundation/pay-kit#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
supabase/agent-skills#607 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno