fix(claudecode): replace dots in project key encoding#852
Closed
KuaaMU wants to merge 1 commit into
Closed
Conversation
Fixes #842 encodeClaudeProjectKey was not replacing '.' with '-', causing a mismatch with Claude Code 2.1.91 which does replace dots. This meant /list would return 0 sessions for any username or path containing a dot (e.g. /home/john.doe/projects).
Owner
|
Thanks for the fix! This PR addresses the same issue as #820, which was submitted by @Re-TinyLin and has already been reviewed and approved. To avoid duplicate history in main, I'll defer to #820 for the merge. Closing in favor of #820. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #842
Environment
Root Cause
encodeClaudeProjectKeyinagent/claudecode/claudecode.goreplaces/,:,_,,~with-but does not replace.(dot).Claude Code 2.1.91 does replace dots in its project key encoding. This means any workspace path containing a dot (e.g.
/Users/yinglong.li/projects/myapp) produces a different key than what Claude Code writes to disk, causingfindProjectDirto fail and/listto return 0 sessions.Reproduction
yinglong.li)/listin the messaging platformFix
Added
.to the replacement set inencodeClaudeProjectKey, matching Claude Code 2.1.91 behavior.Tests
go test ./agent/claudecode/ -run TestEncodeClaudeProjectKey -vAdded two new test cases:
path with dots in username:/home/john.doe/projects/myapp→-home-john-doe-projects-myapppath with multiple dots:/home/j.doe/src/my.app→-home-j-doe-src-my-appAll 14 tests pass (12 existing + 2 new).