Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(chat): show one usage-limit recovery notice #29292

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/29292/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 10 changed files with 114 additions and 58 deletions (loading 8).

x
0 of 10 viewed, 10 left
21 additions and 6 deletionsapps/mobile/src/features/threads/ThreadDetailScreen.tsxModified
View file
@@ -62,6 +62,7 @@
BACKGROUND_WORK_STOP_RETRY_AFTER_MS,
type BackgroundWorkStopRequest,
isBackgroundWorkStopPending,
+ limitRecoveryOwnsSnooze,
presentPendingBackgroundWork,
presentProviderGoal,
} from "@t3tools/client-runtime/state/thread-execution";
@@ -642,6 +643,19 @@
return () => clearTimeout(timer);
// oxlint-disable-next-line react/exhaustive-effect-dependencies -- Re-arm if timer clamping fires before the wake time.
}, [snoozed, snoozedUntil, lifecycleNow]);
+ // The usage-limit recovery card shows this snooze and its Wake now.
+ const lifecycleSnoozed =
+ snoozed &&
+ !limitRecoveryOwnsSnooze({
+ runId:
+ props.selectedThread.runtime?.status === "failed" &&
+ props.selectedThread.runtime.lastErrorClass === "usage_limit"
+ ? props.selectedThread.latestRun?.runId
+ : null,
+ resetAt: props.selectedThread.runtime?.usageLimitResetAt,
+ recovery: props.selectedThread.limitRecovery,
+ snoozedUntil,
+ });
const settled = configLoaded && props.selectedThread.settledOverride === "settled";
const wokeAt = configLoaded ? threadWokeAt(props.selectedThread, { now: lifecycleNow }) : null;
const woke = isThreadWokeUnseen({