Fix Claude task recovery for worktree paths#228
Merged
DeadWaveWave merged 2 commits intomainfrom May 6, 2026
Merged
Conversation
f27acfc to
b83ce0b
Compare
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.
?? Change Scope
?? What Does This PR Do?
Fixes Claude Code task-agent recovery for installed Windows builds when the task runs inside
.opencove/worktrees/...paths.Claude Code encodes project directories by replacing every non-alphanumeric character with
-. OpenCove only replaced:,\, and/, so paths containing.opencovewere searched as-.opencove-...while Claude wrote session JSONL files under--opencove-.... The installed app then failed to detect the Claude session id, persistedresumeSessionId=null, and could not restore the task-launched Claude session after restart.This PR updates the shared Claude project path encoder, preserves both legacy encodings as compatibility fallbacks, and updates the Claude test stub so E2E exercises the same path shape as real Claude Code.
??? Large Change Spec (Required if "Large Change" is checked)
1. Context & Business Logic
Task-launched Claude agents must persist a verified
resumeSessionIdafter launch so restart recovery can rebuild the task-agent-session relationship. The bug only appeared for installed app paths using hidden worktree folders because Claude's actual project directory encoding differed from OpenCove's locator.2. State Ownership & Invariants
resumeSessionId/resumeSessionIdVerified; task history is only a recoverable record/projection..opencove/worktrees/...persist and restore the same verified binding after restart.3. Verification Plan & Regression Layer
.opencoveworktree paths, legacy encodings, locator, file resolver, and session catalog..opencove/worktrees/...directory and verifies restart recovery plus terminal geometry.pnpm pre-commitpassed.? Delivery & Compliance Checklist
pnpm pre-commitis completely green.CLA.md).DEVELOPMENT.mdarchitectural boundaries.?? Screenshots / Visual Evidence
N/A: this is a recovery/path-discovery fix with no visual UI change. The Windows task Claude recovery E2E passed.