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:
@@ -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),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user