Skip to content

Commit 5113703

Browse files
saltboCopilot
andcommitted
fix(daemon): skip closed/completing sessions when seeding pr-monitor
On daemon restart, prMonitor.start() was seeding tracked tasks from all on-disk worker sessions including those in 'closed' state. Previously session files were deleted on completion, but now they are retained for history lookup. This caused noisy startup logs as the monitor immediately untracked already-done/cancelled tasks on the first check. Fix: skip sessions with status 'closed' or 'completing' when seeding, since those tasks are already terminal and need no PR monitoring. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cdb3d7b commit 5113703

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/cli/src/daemon/prMonitor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export class PrMonitor {
3434
// in_progress), we still observe it.
3535
const sm = getSessionManager();
3636
for (const s of sm.list({ type: "worker" })) {
37-
if (s.taskId) this.trackedTasks.add(s.taskId);
37+
if (s.taskId && s.status !== "closed" && s.status !== "completing") {
38+
this.trackedTasks.add(s.taskId);
39+
}
3840
}
3941
saveTrackedTasks(this.trackedTasks);
4042
this.timer = setInterval(() => this.check(), PR_CHECK_INTERVAL);

0 commit comments

Comments
 (0)