fix: harden worktree dependency hydration

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-04-04 18:37:19 -05:00
parent 8ae4c0e765
commit c19208010a
2 changed files with 60 additions and 28 deletions
+4
View File
@@ -779,6 +779,8 @@ function enrichWakeContextSnapshot(input: {
contextSnapshot[WAKE_COMMENT_IDS_KEY] = wakeCommentIds;
contextSnapshot.commentId = latestCommentId;
contextSnapshot.wakeCommentId = latestCommentId;
// Once comment ids are normalized into the snapshot, rebuild the structured
// wake payload from those ids later instead of carrying forward stale data.
delete contextSnapshot[PAPERCLIP_WAKE_PAYLOAD_KEY];
} else if (!readNonEmptyString(contextSnapshot["wakeCommentId"]) && wakeCommentId) {
contextSnapshot.wakeCommentId = wakeCommentId;
@@ -814,6 +816,8 @@ export function mergeCoalescedContextSnapshot(
merged[WAKE_COMMENT_IDS_KEY] = mergedCommentIds;
merged.commentId = latestCommentId;
merged.wakeCommentId = latestCommentId;
// The merged context should carry canonical comment ids; the next wake will
// regenerate any structured payload from those ids.
delete merged[PAPERCLIP_WAKE_PAYLOAD_KEY];
}
return merged;