Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

ClosedAbsterrg0(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/15176/headopened View on GitHub

Showing 2 changed files with 117 additions and 27 deletions.

x
0 of 2 viewed, 2 left
32 additions and 27 deletionspackages/client-runtime/src/state/threadSettled.tsModified
View file
@@ -95,7 +95,7 @@
/**
* A snoozed thread "raises its hand" when something happens that outranks
* the user's snooze: the agent is blocked on them (approval / user input),
- * the session failed, or a run completed after the snooze was set — the
+ * or a run failed or completed after the snooze was set — the
* v1 taste of event-based snooze ("something happened" wakes early).
* Raising a hand never clears the server-side snooze fields; it only stops
* the thread from classifying as snoozed.
@@ -103,27 +103,41 @@
export function threadRaisedHandWhileSnoozed(shell: ThreadSnoozeShell): boolean {
if (shell.hasPendingApprovals || shell.hasPendingUserInput) return true;
const runtime = shell.runtime ?? shell.session ?? null;
- const latestRun = shell.latestRun ?? shell.latestTurn ?? null;
// 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". session.updatedAt stamps the status edge, so an error newer than
- // the snooze is new information.
- if (
- (runtime?.status === "error" || runtime?.status === "failed") &&
- (shell.snoozedAt == null ||
- (runtime.updatedAt != null && Date.parse(runtime.updatedAt) > Date.parse(shell.snoozedAt)))
- ) {
+ // now".
+ if ((runtime?.status === "error" || runtime?.status === "failed") && shell.snoozedAt == null) {
return true;
- if (
+ if (snoozeWakingRunEndedAt(shell) !== null) return true;