fix: start a fresh session on /switch instead of resuming the old one (v0.1.11)#15
Merged
Conversation
/switch and /switch - used killSession, which kills the process but keeps the SessionManager entry (including the stored session id). On the next message, ensure() would try to --resume that session id in the NEW working directory — but it belongs to the OLD directory, so Claude exits with code 1 and never responds (most visible in channels). Use clearSession instead so the stored session id is forgotten and a fresh session starts in the new directory. Continuing a conversation across working directories is meaningless anyway. - commands.ts: cmdSwitch (switch / revert-to-default) now clearSession - wording "Session resumes" → "A fresh session starts" - test updated to expect clearSession - version 0.1.10 → 0.1.11 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review WalkthroughIn ChangescmdSwitch clearSession behavior change
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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.
Bug
/switchand/switch -usedkillSession, which kills the process but keeps theSessionManagerentry (including the stored session id). On the next message,ensure()would try to--resumethat session id in the new working directory — but it belongs to the old directory, so Claude exits withcode 1and never responds (most visible in channels: after/switch, the bot goes silent).Fix
Use
clearSessioninstead, so the stored session id is forgotten and a fresh session starts in the new directory. Continuing a conversation across working directories is meaningless anyway.commands.ts:cmdSwitch(switch / revert-to-default) now usesclearSessionSession resumes→A fresh session startsclearSessionVerification
Reproduced and fixed on the GitLab sibling repo (v0.1.7), verified on Iris-dev: after
/switch, follow-up messages now get a response; thecode=1respawn loop is gone (confirmed in logs).pnpm verifygreen (87 tests).🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Bug Fixes
/switch -command to properly clear the session state, ensuring a fresh session initializes on the next message instead of resuming from a previous session state