Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CJK workspace paths collapse to the same project session directory — sessions from different projects get mixed together(中文路径项目会话串扰)

Open
#3,231 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
desktop

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 目录)同样共用一个目录
  • 用户往往在升级后才发现,误以为是升级造成的

我们目前的临时解法(已验证有效)

  1. 给受影响的项目文件夹加 ASCII 后缀(如 上海一妇婴合作 → 上海一妇婴合作-FH),使每个 slug 唯一
  2. 按每个会话 metadata.json 的 workspacePath,把会话目录搬回各自的新 slug 目录
  3. 同步改写 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GCWing/OpenBitFun

All issues in GCWing/OpenBitFun

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.