handle all session conflict scenarios inside claude and giving instructions#69
handle all session conflict scenarios inside claude and giving instructions#69
Conversation
…ctions Entire-Checkpoint: c283d360e6d5
There was a problem hiding this comment.
Pull request overview
This pull request improves session conflict handling in Claude Code by displaying user-friendly blocking messages instead of returning errors. The changes ensure that when session conflicts occur (from parallel sessions, uncommitted changes, or cross-worktree scenarios), users receive clear instructions within the Claude interface rather than encountering error states.
Changes:
- Modified conflict handlers to output blocking JSON responses with actionable guidance
- Updated test infrastructure to verify blocking behavior via parsed hook responses
- Refined conflict detection tests to validate new response format
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/entire/cli/integration_test/session_conflict_test.go | Updated test to verify blocking JSON response for session conflicts; removed formatting whitespace |
| cmd/entire/cli/integration_test/hooks.go | Added HookResponse struct and SimulateUserPromptSubmitWithResponse method to support testing blocking hook behavior |
| cmd/entire/cli/hooks_claudecode_handlers.go | Changed shadow branch and session ID conflict handlers to output blocking JSON responses instead of returning errors, with cleaner message formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
we may want to consider our shadow branch naming to include either branch or cwd hints, and/or using our other session state/metadata to reference it to avoid the worktree problem? |
|
yeah agree, but this is just fixing that it's at least not throwing an error in the face of the user. Let's handle in another PR? |
We had this implemented for when you run two parallel claude code sessions (without closing the first one first) but there are two more scenarios where this is needed:
Should fix: https://linear.app/entirehq/issue/ENT-102/error-when-exiting-plan-mode