Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(clients): a thread snoozed until a limit reset stays snoozed until the reset #21520

ClosedAbsterrg0(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/21520/headopened View on GitHub

Showing 2 changed files with 118 additions and 24 deletions.

x
0 of 2 viewed, 2 left
33 additions and 24 deletionspackages/client-runtime/src/state/threadSettled.tsModified
View file
@@ -82,23 +82,41 @@
if (shell.hasPendingApprovals || shell.hasPendingUserInput) return true;
if (shell.pendingSubagentRequest != null) return true;
const runtime = shell.runtime ?? shell.session ?? null;
- const latestRun = shell.latestRun ?? shell.latestTurn ?? null;
- if (
- (runtime?.status === "error" || runtime?.status === "failed") &&
- (shell.snoozedAt == null ||
- (runtime.updatedAt != null && Date.parse(runtime.updatedAt) > Date.parse(shell.snoozedAt)))
- ) {
+ // Only a FRESH failure raises the hand: a thread snoozed while already
+ // failed stays snoozed — that snooze was the user saying "I saw it, not
+ // now".
+ if ((runtime?.status === "error" || runtime?.status === "failed") && shell.snoozedAt == null) {
return true;
- if (
+ if (snoozeWakingRunEndedAt(shell) !== null) return true;
+ // Legacy session-shaped shells stamp the status edge on session.updatedAt,
+ // so an error newer than the snooze is new information. Runtime shells
+ // carry projection activity time there instead, which any later event
+ // (a rename, title regeneration) advances without a new failure.
+ return (
+ shell.runtime == null &&
+ shell.session?.status === "error" &&
+ shell.session.updatedAt != null &&
shell.snoozedAt != null &&
- (latestRun?.state === "completed" || latestRun?.status === "completed") &&
- latestRun.completedAt != null &&
- Date.parse(latestRun.completedAt) > Date.parse(shell.snoozedAt)