Skip to content

Commit 7a34062

Browse files
committed
fix(client): keep snoozed failures hidden without completion times
1 parent cefb544 commit 7a34062

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎packages/client-runtime/src/state/threadSettled.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ export function threadRaisedHandWhileSnoozed(shell: ThreadSnoozeShell): boolean
9696
);
9797
}
9898

99-
// V2 runtime.updatedAt includes metadata writes; prefer the failed run's completion.
99+
// V2 runtime.updatedAt includes metadata writes, not just failures.
100100
// Legacy sessions only expose the runtime timestamp.
101101
function failureEdgeAt(shell: ThreadSnoozeShell): string | null | undefined {
102102
const runtime = shell.runtime ?? shell.session ?? null;
103103
if (runtime?.status !== "error" && runtime?.status !== "failed") return undefined;
104104
const latestRun = shell.latestRun ?? shell.latestTurn ?? null;
105-
if (latestRun?.status === "failed" && latestRun.completedAt != null) {
106-
return latestRun.completedAt;
105+
if (latestRun?.status === "failed") {
106+
return latestRun.completedAt ?? null;
107107
}
108108
return runtime.updatedAt ?? null;
109109
}

‎packages/client-runtime/src/state/threadSnoozed.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ describe("effectiveSnoozed", () => {
9696
pending: undefined,
9797
wokeAt: null,
9898
},
99+
{
100+
reason: "failure without a completion timestamp",
101+
completedAt: null,
102+
pending: undefined,
103+
wokeAt: null,
104+
},
105+
{
106+
reason: "approval without a failure completion timestamp",
107+
completedAt: null,
108+
pending: "approval",
109+
wokeAt: "2026-04-10T11:00:00.000Z",
110+
},
99111
{
100112
reason: "fresh failure",
101113
completedAt: "2026-04-10T10:00:00.000Z",

0 commit comments

Comments
 (0)