Session switched projects on its own — duplicate session IDs across project directories
@aliarain đang làm issue này rồi.
Từ ngày 7/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Shell
- Star
- 80
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommandCodeAI/desktop
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/desktop#94 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/desktop#66 · 1 bình luận · 2 reaction ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
CommandCodeAI/desktop#104 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
CommandCodeAI/desktop#103 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
CommandCodeAI/desktop#102 ·
Tất cả issue của CommandCodeAI/desktop
Issue tương tự
-
stack resolver is outdated Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
koalaman/shellcheck#3539 ·
-
out-of-date
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
CachyOS/CachyOS-PKGBUILDS#1894 ·
-
[InvoiceShelf] No database info Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
community-scripts/ProxmoxVE#17396 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mattpocock/skills#1099 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100