Session switched projects on its own — duplicate session IDs across project directories
@aliarain 已經在處理了。
開始於 2026年9月7日。
評估
這個 Issue 還沒有評估資料。
描述
Session switched projects on its own — duplicate session IDs across project directories
Summary
With two projects registered in Command Code Desktop, a session spontaneously started referencing the wrong project. No manual project switch was made. Investigation shows the same session IDs exist in both project directories with completely different transcripts, indicating a cross-project session collision.
Environment
- OS: Windows
- App: Command Code Desktop v0.1.22 → v0.1.25 (auto-updated during session window)
- Projects: 2 projects registered ~1 hour apart (Project A and Project B)
- Session where bug was reported:
KYLwd2_uwfTpKTw6JyVnr— "Session Switch Bug" (2026-09-03)
Evidence — duplicate session IDs in both project slugs
Sessions are stored per docs as ~/.commandcode/projects/<project-slug>/<session-id>.jsonl (header records cwd). Two IDs exist in both slugs with divergent content:
ID 0OdgweRGWNjtJoVOitaAw
| Project A slug | Project B slug | |
|---|---|---|
.meta.json title |
Install Agent Browser |
Explore Repository |
.jsonl header cwd |
Project A root | Project B root |
| header timestamp | 2026-09-02T13:27:41Z |
2026-09-02T12:41:22Z |
| first user message | install agent browser |
explore AGENTS.md |
ID ClB46Yifwhg5QzUo8NIP-
| Project A slug | Project B slug | |
|---|---|---|
.meta.json title |
Deployment Exploration |
Run Project |
.jsonl header cwd |
Project A root | Project B root |
| header timestamp | 2026-09-03T05:52:54Z |
2026-09-02T13:40:13Z |
| first user message | how is this deployed and working without my env? |
run this project |
Each duplicate has completely different traceIds sets in the .meta.json, confirming they are different transcripts, not copies.
Also observed placeholder metas with minimal content in both project dirs (27-byte files).
What happened from the user's perspective
"it changed one projects session to another and started referencing the wrong thing. it switched on its own its not something i did"
Reported during session KYLwd2_uwfTpKTw6JyVnr. The transcript shows normal flow until 503 Service temporarily unavailable / 400 name must match ^[a-zA-Z0-9_.-]+$ errors at the same time.
Logs checked
AppData\Roaming\Command Code\logs\main.log— only startup/updater lines ([thread-index] ready,[updater] checking/up-to-date). No explicit project/session switch entry at bug time.AppData\Roaming\Command Code\app-state.json— confirms 2 projects registered, active thread pointed to one project while session files exist in both.
Expected vs actual
- Expected: Session IDs are globally unique;
~/.commandcode/projects/<slug>/is strictly scoped, picker/resume only shows sessions for the launchedcwd. - Actual: Same ID resolves to two different transcripts on disk; app state collapses both to one
projectPath, so resume/references can pick the wrong file and the session appears to "switch projects."
Repro / clues
- Register two projects (Project B, then Project A ~65 min later).
- Create sessions in each around
2026-09-02. Observe IDs collide. - The newer Project A copy shadows the older Project B copy — unclear if ID generator reused IDs or a copy/migration duplicated files to wrong slug.
Impact
Data integrity — wrong cwd, wrong transcript, potential file edits/checkpoints applied to wrong project.
Suggested fix / next steps
- Ensure session ID generation is globally unique (or namespace by slug) and guard against writing a session with a
cwdthat doesn't match its slug. thread-index.dbshould enforce(id, projectSlug)uniqueness and surface a conflict instead of silently shadowing.- Add diagnostic to
main.logwhen a session file is resolved/loaded that logssessionId + resolved slug + header cwdto make future switches traceable.
Teams can reproduce by checking for duplicate <session-id>.jsonl filenames across ~/.commandcode/projects/*/ and comparing their headers/metas. No user-identifying paths needed.
- 主要語言
- Shell
- 星號
- 89
- 分支
- 7
- 平均合併
- 2 小時 46 分鐘
- 30 天內合併 PR
- 1
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CommandCodeAI/desktop 的其他 Issue
-
[UI Bug][macOS] Sidebar toggle is vertically misaligned with window controls可能已有人在做 @aliarain 於 6 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 70/100
CommandCodeAI/desktop#125 · 1 則留言 · 已指派 1 人 ·
-
[Feedback]: add copy block under a code block可能已有人在做 @aliarain 於 11 天前認領。 未關閉enhancement
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/desktop#94 · 已指派 1 人 ·
-
[Feedback]: Add Expand & Collapse for changes可能已有人在做 @aliarain 於 11 天前認領。 未關閉enhancement
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/desktop#66 · 1 則留言 · 2 個 reaction · 已指派 1 人 ·
-
bug
難度 3/5 1-2 天 新手友好度 48/100
CommandCodeAI/desktop#135 ·
-
難度 5/5 一週以上 新手友好度 45/100
CommandCodeAI/desktop#134 ·
查看 CommandCodeAI/desktop 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
area/tests theme/ci-dx
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
[Bug]: e2e script flag parsing is broken可能已有人在做 @ericcurtin 今天認領。 未關閉area/dev-infra area/tests kind/bug
難度 2/5 1-3 小時 新手友好度 72/100
agent-substrate/substrate#2217 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
FluidNumerics/fluid-walk-blocker#172 ·
維護者通常 1 天內回覆