fix: persist global room sessions in $HOME/.cf_session#3
Open
hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
Open
fix: persist global room sessions in $HOME/.cf_session#3hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
Conversation
Global rooms (in ~/.chatfiles/) now write their session to \$HOME/.cf_session instead of .cf_session in the CWD. This means cf commands work from any directory after registering a global room, fixing the issue where join succeeded but subsequent read/status calls failed because .cf_session wasn't found in the new CWD. Local room sessions continue to use .cf_session in the CWD for directory-scoped isolation. Closes marksverdhei#2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
~/.chatfiles/) now write their session to$HOME/.cf_sessioninstead of.cf_sessionin the CWD.cf_sessionin the CWD (directory-scoped, no behaviour change)test_global_session_persists_across_directoriestest to cover the exact failure scenario from the issueRoot cause
registeralways wrote to.cf_sessionin the current directory. In agent workflows, eachcfinvocation may run from a different working directory, so subsequent commands couldn't find the session file.The existing
find_sessionalready fell back to$HOME/.cf_session— the fix just makesregisterwrite there when the target chatfile is a global room.Test plan
bash test_cf.sh)test_global_session_persists_across_directoriesreproduces the original bug and passescf register <global-room>,cd /tmp,cf statusshould now workCloses #2
🤖 Generated with Claude Code