fix: use stable per-channel owner worktree to preserve session across tasks

Owner worktree path was per-task (data/workspaces/{folder}/tasks/{taskId}/owner/),
causing Claude SDK to treat each new task as a different project and lose session
context. Now uses a stable per-channel path (data/workspaces/{folder}/owner/).

- Channel isolation preserved (different folders get different worktrees)
- Session persists across tasks (same path = same Claude SDK project)
- Reviewer snapshot still reads from owner worktree correctly
- Fix stale approvedHead reference from cherry-pick conflict
This commit is contained in:
Eyejoker
2026-03-29 23:31:14 +09:00
parent 504be9e41a
commit 29ab284c60
2 changed files with 38 additions and 10 deletions

View File

@@ -227,6 +227,8 @@ export function preparePairedExecutionContext(args: {
updated_at: now,
});
}
// Use a stable per-channel worktree (not per-task) so the Claude SDK
// session persists across tasks. Different channels still get isolation.
workspace = provisionOwnerWorkspaceForPairedTask(latestTask.id);
} else {
const reviewerWorkspace = prepareReviewerWorkspaceForExecution(latestTask);
@@ -424,7 +426,6 @@ export function completePairedExecutionContext(args: {
{
taskId,
verdict,
approvedHead,
approvedSourceRef,
summary: args.summary?.slice(0, 100),
},