Skip to content

fix: Chinese path encoding and session resume on Windows#3

Open
AAAAaron wants to merge 2 commits intoeLeanwang:mainfrom
AAAAaron:fix/chinese-path-encoding
Open

fix: Chinese path encoding and session resume on Windows#3
AAAAaron wants to merge 2 commits intoeLeanwang:mainfrom
AAAAaron:fix/chinese-path-encoding

Conversation

@AAAAaron
Copy link
Copy Markdown

Summary

Two fixes for Chinese/non-ASCII project paths on Windows:

1. encodePath() in src/utils/cross-platform.ts

Replace all non-ASCII characters with - to match Claude Code's actual path encoding convention. Without this, a path like D:\tx\定制绘本生成 was encoded as D--tx-定制绘本生成 but Claude Code creates sessions at D--tx-------.

2. validateSessionFile() in src/core/session-manager.ts

Stop clearing agent_session_id from the DB when the session file is not found. This allows session resume to work correctly - the ID is preserved so the SDK can attempt to locate/create the session file.

3. needsSchemaRefactor guard

Add hasIsGroup as a required guard to prevent false-positive migration triggers on already-migrated databases (which caused no such column: deleted_at errors on startup).

Test plan

  • Chinese path project D:\tx\定制绘本生成 resumes existing session
  • Service starts without no such column error
  • Session files are found at correct ~/.claude/projects/D--tx-------/ path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant