CJK workspace paths collapse to the same project session directory — sessions from different projects get mixed together(中文路径项目会话串扰)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Locate the workspace-path slug generation and project/session storage entry points, then inspect how metadata.json, state.json, and workspace_data.json record workspacePath or rootPath. Reproduce the collision with CJK workspace paths and check existing session-directory behavior. Done means distinct projects receive stable directories, existing sessions can be migrated or recovered by workspacePath, and project-derived data is no longer mixed.
Written by the indexing model from the issue text.
Description
Environment: OpenBitFun 1.0.2, macOS (Apple Silicon), local workspaces
TL;DR (English)
The project session storage directory name is derived from the workspace path by lowercasing it, replacing every non-[a-z0-9] character with -, and trimming leading/trailing -. Workspace paths containing CJK characters — especially paths ending with CJK — collapse into the same project directory. As a result, sessions belonging to different projects are stored in one directory and shown mixed together in each project's session list.
复现(真实数据)
一位中文用户的多个工作区,例如:
/Users/frankzhang/Work-2/上海一妇婴合作/Users/frankzhang/Work-2/放射科内合作/王平教授/Users/frankzhang/Work-2/放射科内合作/朱博- ……(Work-2 下 9 个纯中文命名的项目)
由于 slug 算法把每个 CJK 字符替换成 - 并去掉尾部 -,以上所有路径全部坍缩到同一个项目目录:
~/.openbitfun/projects/users-frankzhang-work-2/sessions/<session-id>/
实际统计(本机):
| 坍缩目录 | 混入的项目数 | 混入的会话数 |
|---|---|---|
users-frankzhang-work-2 |
9 个项目 | 37 个会话 |
users-frankzhang-work-3 |
8 个项目 | 42 个会话 |
打开其中任何一个项目,会话列表里都能看到其他项目的对话。而路径含 ASCII 的项目(如 2026.5-全景PETCT、MyCode/pacs_dd、MyPapers/AI_Conferences)完全不受影响。
影响
- 不同项目的会话在界面上互相串,看起来像数据损坏(实际数据未丢:每个会话的
metadata.json里记录的workspacePath是正确的) - 项目级派生数据(snapshot baselines、项目 config 目录)同样共用一个目录
- 用户往往在升级后才发现,误以为是升级造成的
我们目前的临时解法(已验证有效)
- 给受影响的项目文件夹加 ASCII 后缀(如
上海一妇婴合作→上海一妇婴合作-FH),使每个 slug 唯一 - 按每个会话
metadata.json的workspacePath,把会话目录搬回各自的新 slug 目录 - 同步改写
metadata.json/state.json/workspace_data.json(rootPath)等处的旧路径
能彻底解决串会话,但需要对用户文件系统做侵入式改名 + 手工迁移,不适合普通用户。
建议的修复方向
- 项目目录名加入完整路径的短哈希,例如
users-frankzhang-work-2-<sha256 前 8 位>,或对 CJK 做百分号编码,而不是替换成- - 提供一次性迁移:扫描所有会话的
metadata.json,按workspacePath重新归位 - 防御性检查:当计算出的 slug 目录已存在但属于不同
workspacePath时,回退到带哈希的目录名
如需更多数据(目录统计、metadata 样例)可以随时提供。谢谢!
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 236
- Avg merge
- 2h 39m
- Merged PRs (30d)
- 515
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GCWing/OpenBitFun
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GCWing/OpenBitFun#3213 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GCWing/OpenBitFun#2363 ·
Maintainers usually reply within 1 day
-
question
Difficulty 1/5 Under an hour Newbie friendliness 78/100
GCWing/OpenBitFun#2340 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
GCWing/OpenBitFun#3240 ·
Maintainers usually reply within 1 day
-
[Bug]: wayland不兼容Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
GCWing/OpenBitFun#3237 · 1 comment ·
Maintainers usually reply within 1 day
All issues in GCWing/OpenBitFun
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
vercel-labs/agent-browser#2017 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tursodatabase/turso#9405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolyMeilex/Neothesia#447 ·
Maintainers usually reply within 1 day
-
backend::vllm diffusion multimodal
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7985 ·
Maintainers usually reply within 2 days