feat: resume threads after usage limits reset #8577
ClosedKron00(GitHub profile, opens in a new tab)wants to merge 32 commits into
main fromrefs/pull/8577/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/web/src/components/ChatView.tsx lines 6979 to 6979OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -6897,6 +6965,15 @@6897- error={visibleThreadError}6898- onDismiss={() => {6899- setThreadError(activeThread.id, null);6900- dismissThreadErrorBannerForSession(threadErrorBannerKey);6901- setThreadErrorBannerDismissTick((tick) => tick + 1);6902- }}6965+ error={displayedThreadError}6966+ actionLabel={6967+ showUsageLimitResumeBanner6968+ ? usageLimitResume === null6969+ ? "Resume when available"6970+ : "Cancel auto-resume"6971+ : undefined6972+ }6973+ actionDescription={usageLimitActionDescription}6974+ actionPending={usageLimitActionPending}6975+ onAction={6976+ showUsageLimitResumeBanner ? () => void handleUsageLimitResumeAction() : undefined6977+ }6978+ onDismiss={6979+ showUsageLimitResumeBannerapps/web/src/components/ChatView.tsx lines 1644 to 1646OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1631,3 +1638,9 @@16311638 // session.lastError. Bump a tick so the banner hides immediately. Mirrors16321639 // the branch mismatch banner.16331640 const [, setThreadErrorBannerDismissTick] = useState(0);1641+ const usageLimitResume = activeServerThread?.usageLimitResume ?? null;1642+ const isUsageLimitError = activeServerThread?.session?.lastErrorClass === "usage_limit";1643+ const showUsageLimitResumeBanner = isUsageLimitError || usageLimitResume !== null;1644+ const displayedThreadError = showUsageLimitResumeBanner1645+ ? (threadError ?? "T3 is resuming this thread now.")1646+ : visibleThreadError;apps/web/src/components/ChatView.tsx lines 1651 to 1654OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1631,3 +1638,17 @@16311638 // session.lastError. Bump a tick so the banner hides immediately. Mirrors16321639 // the branch mismatch banner.16331640 const [, setThreadErrorBannerDismissTick] = useState(0);1641+ const usageLimitResume = activeServerThread?.usageLimitResume ?? null;1642+ const isUsageLimitError = activeServerThread?.session?.lastErrorClass === "usage_limit";1643+ const showUsageLimitResumeBanner = isUsageLimitError || usageLimitResume !== null;1644+ const displayedThreadError = showUsageLimitResumeBanner1645+ ? (threadError ?? "T3 is resuming this thread now.")1646+ : visibleThreadError;1647+ const usageLimitActionDescription =1648+ usageLimitResume?.nextAttemptAt === null1649+ ? "Trying again now. Cancel to stop further automatic retries."1650+ : usageLimitResume?.nextAttemptAt1651+ ? `Automatic resume scheduled for ${new Intl.DateTimeFormat(undefined, {1652+ dateStyle: "medium",1653+ timeStyle: "short",1654+ }).format(new Date(usageLimitResume.nextAttemptAt))}.`
- apps/web/src/components/ChatView.tsx line 1656OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1631,3 +1638,19 @@16311638 // session.lastError. Bump a tick so the banner hides immediately. Mirrors16321639 // the branch mismatch banner.16331640 const [, setThreadErrorBannerDismissTick] = useState(0);1641+ const usageLimitResume = activeServerThread?.usageLimitResume ?? null;1642+ const isUsageLimitError = activeServerThread?.session?.lastErrorClass === "usage_limit";1643+ const showUsageLimitResumeBanner = isUsageLimitError || usageLimitResume !== null;1644+ const displayedThreadError = showUsageLimitResumeBanner1645+ ? (threadError ?? "T3 is resuming this thread now.")1646+ : visibleThreadError;1647+ const usageLimitActionDescription =1648+ usageLimitResume?.nextAttemptAt === null1649+ ? "Trying again now. Cancel to stop further automatic retries."1650+ : usageLimitResume?.nextAttemptAt1651+ ? `Automatic resume scheduled for ${new Intl.DateTimeFormat(undefined, {1652+ dateStyle: "medium",1653+ timeStyle: "short",1654+ }).format(new Date(usageLimitResume.nextAttemptAt))}.`1655+ : undefined;1656+ const [usageLimitActionPending, setUsageLimitActionPending] = useState(false);apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1696OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1520,10 +1684,13 @@15201684 event.type === "thread.turn-interrupt-requested" ||15211685 event.type === "thread.approval-response-requested" ||15221686 event.type === "thread.user-input-response-requested" ||1523- event.type === "thread.session-stop-requested"1687+ event.type === "thread.session-stop-requested" ||1688+ event.type === "thread.usage-limit-resume-scheduled" ||1689+ event.type === "thread.usage-limit-resume-cancelled" ||1690+ event.type === "thread.usage-limit-resume-attempted"15241691 ) {15251692 return yield* worker.enqueue(event);15261693 }15271694 });1528169515291696 yield* forkParked(Stream.runForEach(orchestrationEngine.streamDomainEvents, processEvent));apps/server/src/provider/Layers/ClaudeAdapter.ts lines 3118 to 3118OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -3025,8 +3105,14 @@30253105 return;30263106 }302731073028- const status = turnStatusFromResult(message);3029- const errorMessage = resultUserFacingError(message);3108+ const apiError = resultApiError(message, context.apiErrorMessage);3109+ context.apiErrorMessage = undefined;3110+ const status = apiError === undefined ? turnStatusFromResult(message) : "failed";3111+ const errorMessage = apiError?.message ?? resultUserFacingError(message);3030311230313113 if (status === "failed") {3032- yield* emitRuntimeError(context, errorMessage ?? "Claude turn failed.");3114+ yield* emitRuntimeError(3115+ context,3116+ errorMessage ?? "Claude turn failed.",3117+ apiError === undefined ? undefined : message,3118+ apiError?.usageLimit ?? context.usageLimitError,apps/server/src/orchestration/decider.ts line 974Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -672,0 +771,21 @@771+ aggregateKind: "thread",772+ aggregateId: command.threadId,773+ occurredAt,774+ commandId: command.commandId,775+ })),776+ type: "thread.usage-limit-resume-cancelled",777+ payload: {778+ threadId: command.threadId,779+ updatedAt: thread.usageLimitResume == null ? thread.updatedAt : occurredAt,780+ },781+ };782+ }783+784+ case "thread.usage-limit-resume.attempt": {785+ const thread = yield* requireThread({786+ readModel,787+ command,788+ threadId: command.threadId,789+ });790+ const current = thread.usageLimitResume ?? null;791+ const shouldResume =packages/contracts/src/orchestration.ts line 1083Resolvedby Kron00(GitHub profile, opens in a new tab)@@ -1041,3 +1080,4 @@10411080 createdAt: IsoDateTime,10421081 });104310821083+const ThreadUsageLimitResumeAttemptCommand = Schema.Struct({apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts lines 1955 to 1959Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1912,0 +1939,21 @@1939+ ? { providerRetryAt: event.payload.retryAt }1940+ : {}),1941+ }),1942+ attempt: thread.usageLimitResume.attempt,1943+ createdAt: now,1944+ });1945+ } else {1946+ yield* orchestrationEngine.dispatch({1947+ type: "thread.usage-limit-resume.cancel",1948+ commandId: yield* providerCommandId(event, "usage-limit-resume-cancel"),1949+ threadId: thread.id,1950+ });1951+ }1952+ }1953+ }1954+1955+ if (1956+ event.type === "turn.completed" &&1957+ normalizeRuntimeTurnState(event.payload.state) === "completed" &&1958+ thread.usageLimitResume != null1959+ ) {
- apps/web/src/components/ChatView.tsx lines 1645 to 1652OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1631,3 +1639,14 @@16311639 // session.lastError. Bump a tick so the banner hides immediately. Mirrors16321640 // the branch mismatch banner.16331641 const [, setThreadErrorBannerDismissTick] = useState(0);1642+ const usageLimitResume = activeServerThread?.usageLimitResume ?? null;1643+ const isUsageLimitError = activeServerThread?.session?.lastErrorClass === "usage_limit";1644+ const showUsageLimitResumeBanner = isUsageLimitError || usageLimitResume !== null;1645+ const displayedThreadError = showUsageLimitResumeBanner1646+ ? (threadError ??1647+ (usageLimitResume === null1648+ ? "This thread reached its usage limit."1649+ : usageLimitResume.nextAttemptAt === null1650+ ? "T3 is resuming this thread now."1651+ : "T3 will resume this thread automatically."))1652+ : visibleThreadError;
- apps/server/src/orchestration/decider.ts lines 800 to 800OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -672,0 +780,21 @@780+ command,781+ threadId: command.threadId,782+ });783+ const occurredAt = yield* nowIso;784+ return {785+ ...(yield* withEventBase({786+ aggregateKind: "thread",787+ aggregateId: command.threadId,788+ occurredAt,789+ commandId: command.commandId,790+ })),791+ type: "thread.usage-limit-resume-cancelled",792+ payload: {793+ threadId: command.threadId,794+ updatedAt: thread.usageLimitResume == null ? thread.updatedAt : occurredAt,795+ },796+ };797+ }798+799+ case "thread.usage-limit-resume.attempt": {800+ const thread = yield* requireThread({
- apps/server/src/orchestration/decider.ts lines 828 to 828OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -672,0 +808,21 @@808+ aggregateKind: "thread",809+ aggregateId: command.threadId,810+ occurredAt,811+ commandId: command.commandId,812+ })),813+ type: "thread.usage-limit-resume-cancelled",814+ payload: {815+ threadId: command.threadId,816+ updatedAt: thread.usageLimitResume == null ? thread.updatedAt : occurredAt,817+ },818+ };819+ }820+821+ case "thread.usage-limit-resume.attempt": {822+ const thread = yield* requireThreadNotArchived({823+ readModel,824+ command,825+ threadId: command.threadId,826+ });827+ const current = thread.usageLimitResume ?? null;828+ if (thread.settledOverride === "settled" && current !== null) {
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1323Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1227,0 +1247,21 @@1247+ yield* Effect.sleep(Duration.millis(delayMillis));1248+ const createdAt = DateTime.formatIso(yield* DateTime.now);1249+ yield* orchestrationEngine.dispatch({1250+ type: "thread.usage-limit-resume.attempt",1251+ commandId: yield* serverCommandId("usage-limit-resume-attempt"),1252+ threadId,1253+ expectedAttemptAt: resumeAt,1254+ createdAt,1255+ });1256+ });1257+1258+ const replaceUsageLimitResumeSchedule = Effect.fn("replaceUsageLimitResumeSchedule")(function* (1259+ threadId: ThreadId,1260+ resumeAt: string,1261+ ) {1262+ const previous = usageLimitResumeFibers.get(threadId);1263+ if (previous !== undefined) {1264+ yield* Fiber.interrupt(previous).pipe(Effect.ignore);1265+ }1266+ const fiber = yield* scheduleUsageLimitResumeAttempt(threadId, resumeAt).pipe(1267+ Effect.catchCause((cause) =>
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1395Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1227,0 +1323,21 @@1323+ const usageLimitResume = thread.usageLimitResume ?? null;1324+ if (1325+ usageLimitResume === null ||1326+ usageLimitResume.nextAttemptAt !== null ||1327+ usageLimitResume.attempt !== event.payload.attempt ||1328+ thread.deletedAt !== null ||1329+ thread.settledOverride === "settled"1330+ ) {1331+ return;1332+ }1333+ yield* ensureThreadWorktree(thread);1334+1335+ const retryOrCancel = (cause: Cause.Cause<unknown>) =>1336+ Effect.gen(function* () {1337+ if (Cause.hasInterruptsOnly(cause)) {1338+ return;1339+ }1340+ const detail = formatFailureDetail(cause);1341+ const usageLimit = providerUsageLimitFromError({ message: detail });1342+ const createdAt = DateTime.formatIso(yield* DateTime.now);1343+ yield* setThreadSessionErrorOnTurnStartFailure({
- apps/web/src/components/chat/ThreadErrorBanner.tsx lines 69 to 69OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -52,9 +60,10 @@5260 {error}5361 </TooltipPopup>5462 </Tooltip>63+ {actionDescription ? <div className="text-xs">{actionDescription}</div> : null}5564 </AlertDescription>56- {onDismiss && (65+ {(onAction || onDismiss) && (5766 <AlertAction>58- <Button variant="ghost" size="icon-xs" aria-label="Dismiss error" onClick={onDismiss}>59- <XIcon className="text-destructive" />60- </Button>67+ {onAction && actionLabel ? (68+ <Button variant="outline" size="xs" disabled={actionPending} onClick={onAction}>69+ {actionPending ? "Saving…" : actionLabel}
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts lines 1789 to 1796OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1529,0 +1776,21 @@1776+ ({ threadId, resumeAt, attempt }) =>1777+ resumeAt !== null1778+ ? replaceUsageLimitResumeSchedule(threadId, resumeAt)1779+ : Effect.gen(function* () {1780+ const createdAt = DateTime.formatIso(yield* DateTime.now);1781+ yield* orchestrationEngine.dispatch({1782+ type: "thread.usage-limit-resume.retry",1783+ commandId: yield* serverCommandId("usage-limit-resume-recover"),1784+ threadId,1785+ resumeAt: nextUsageLimitRetryAt({ now: createdAt, attempt }),1786+ attempt,1787+ createdAt,1788+ });1789+ }).pipe(1790+ Effect.catchCause((cause) =>1791+ Effect.logWarning(1792+ "provider command reactor failed to recover an in-flight usage-limit resume",1793+ { threadId, cause: Cause.pretty(cause) },1794+ ),1795+ ),1796+ ),
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1395Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1227,0 +1330,21 @@1330+ const usageLimitResume = thread.usageLimitResume ?? null;1331+ if (1332+ usageLimitResume === null ||1333+ usageLimitResume.nextAttemptAt !== null ||1334+ usageLimitResume.attempt !== event.payload.attempt ||1335+ thread.deletedAt !== null ||1336+ thread.settledOverride === "settled"1337+ ) {1338+ return;1339+ }1340+ yield* ensureThreadWorktree(thread);1341+1342+ const retryOrCancel = (cause: Cause.Cause<unknown>) =>1343+ Effect.gen(function* () {1344+ if (Cause.hasInterruptsOnly(cause)) {1345+ return;1346+ }1347+ const detail = formatFailureDetail(cause);1348+ const usageLimit = providerUsageLimitFromError({ message: detail });1349+ const createdAt = DateTime.formatIso(yield* DateTime.now);1350+ yield* setThreadSessionErrorOnTurnStartFailure({
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts lines 1270 to 1273Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1227,0 +1243,21 @@1243+ effect: Effect.Effect<A, E, R>,1244+ input: {1245+ readonly threadId: ThreadId;1246+ readonly operation: "attempt" | "retry" | "cancel";1247+ },1248+ ): Effect.Effect<A, E, R> =>1249+ effect.pipe(1250+ Effect.tapError((error) =>1251+ Effect.logWarning("provider command reactor usage-limit dispatch failed; retrying", {1252+ threadId: input.threadId,1253+ operation: input.operation,1254+ error,1255+ }),1256+ ),1257+ Effect.retry({1258+ schedule: Schedule.exponential("1 second").pipe(1259+ Schedule.modifyDelay(({ duration }) =>1260+ Effect.succeed(Duration.min(duration, Duration.seconds(30))),1261+ ),1262+ ),1263+ }),
- apps/web/src/components/ChatView.tsx lines 1645 to 1651OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1631,3 +1639,13 @@16311639 // session.lastError. Bump a tick so the banner hides immediately. Mirrors16321640 // the branch mismatch banner.16331641 const [, setThreadErrorBannerDismissTick] = useState(0);1642+ const usageLimitResume = activeServerThread?.usageLimitResume ?? null;1643+ const isUsageLimitError = activeServerThread?.session?.lastErrorClass === "usage_limit";1644+ const showUsageLimitResumeBanner = isUsageLimitError || usageLimitResume !== null;1645+ const displayedThreadError =1646+ usageLimitResume !== null1647+ ? (threadError ??1648+ (usageLimitResume.nextAttemptAt === null1649+ ? "T3 is resuming this thread now."1650+ : "T3 will resume this thread automatically."))1651+ : visibleThreadError;
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1344OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1227,0 +1324,21 @@1324+ });1325+1326+ const processUsageLimitResumeAttempted = Effect.fn("processUsageLimitResumeAttempted")(function* (1327+ event: Extract<ProviderIntentEvent, { type: "thread.usage-limit-resume-attempted" }>,1328+ ) {1329+ if (!event.payload.shouldResume) {1330+ return;1331+ }1332+ const thread = yield* resolveThread(event.payload.threadId);1333+ if (!thread) {1334+ return;1335+ }1336+ const usageLimitResume = thread.usageLimitResume ?? null;1337+ if (1338+ usageLimitResume === null ||1339+ usageLimitResume.nextAttemptAt !== null ||1340+ usageLimitResume.attempt !== event.payload.attempt ||1341+ thread.deletedAt !== null ||1342+ thread.settledOverride === "settled"1343+ ) {1344+ return;apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts line 1965OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1912,0 +1945,21 @@1945+ } else {1946+ yield* orchestrationEngine.dispatch({1947+ type: "thread.usage-limit-resume.cancel",1948+ commandId: yield* providerCommandId(event, "usage-limit-resume-cancel"),1949+ threadId: thread.id,1950+ });1951+ }1952+ }1953+ }1954+1955+ if (1956+ shouldApplyThreadLifecycle &&1957+ event.type === "turn.completed" &&1958+ normalizeRuntimeTurnState(event.payload.state) === "completed" &&1959+ thread.usageLimitResume != null1960+ ) {1961+ yield* orchestrationEngine.dispatch({1962+ type: "thread.usage-limit-resume.cancel",1963+ commandId: yield* providerCommandId(event, "usage-limit-resume-completed"),1964+ threadId: thread.id,1965+ });
- apps/web/src/components/ChatView.tsx lines 1651 to 1652OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1631,3 +1640,13 @@16311640 // session.lastError. Bump a tick so the banner hides immediately. Mirrors16321641 // the branch mismatch banner.16331642 const [, setThreadErrorBannerDismissTick] = useState(0);1643+ const usageLimitResume = activeServerThread?.usageLimitResume ?? null;1644+ const isUsageLimitError = activeServerThread?.session?.lastErrorClass === "usage_limit";1645+ const { errorBannerError: displayedThreadError, showStatusBanner: showUsageLimitResumeStatus } =1646+ resolveUsageLimitResumePresentation({1647+ threadError,1648+ visibleThreadError,1649+ hasScheduledResume: usageLimitResume !== null,1650+ });1651+ const showUsageLimitResumeErrorAction =1652+ displayedThreadError !== null && (isUsageLimitError || usageLimitResume !== null);
- apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts lines 1625 to 1628OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1619,3 +1622,7 @@16191622 : status === "ready"16201623 ? null16211624 : (thread.session?.lastError ?? null);1625+ const preservesErrorMetadata =1626+ (event.type === "session.state.changed" && event.payload.state === "error") ||1627+ (event.type === "turn.completed" &&1628+ normalizeRuntimeTurnState(event.payload.state) === "failed");
- apps/server/src/orchestration/decider.ts line 452Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -406,4 +406,4 @@406406 }407407408408 case "thread.archive": {409- yield* requireThreadNotArchived({409+ const thread = yield* requireThreadNotArchived({
- apps/server/src/orchestration/decider.ts line 799Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -670,3 +772,4 @@670772 };671773 }672774775+ case "thread.usage-limit-resume.schedule": {
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1452OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1227,0 +1432,21 @@1432+ }),1433+ { threadId: event.payload.threadId, operation: "cancel" },1434+ );1435+ }1436+ });1437+1438+ const sendTurnRequest = yield* buildSendTurnRequestForThread({1439+ threadId: event.payload.threadId,1440+ messageText: "Continue from where you left off.",1441+ interactionMode: thread.interactionMode,1442+ createdAt: event.occurredAt,1443+ }).pipe(1444+ Effect.map(Option.some),1445+ Effect.catchCause((cause) => retryOrCancel(cause).pipe(Effect.as(Option.none()))),1446+ );1447+ if (Option.isNone(sendTurnRequest)) {1448+ return;1449+ }1450+ yield* providerService1451+ .sendTurn(sendTurnRequest.value)1452+ .pipe(Effect.catchCause(retryOrCancel), Effect.forkScoped);apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts line 1964OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1912,0 +1944,21 @@1944+ } else {1945+ yield* orchestrationEngine.dispatch({1946+ type: "thread.usage-limit-resume.cancel",1947+ commandId: yield* providerCommandId(event, "usage-limit-resume-cancel"),1948+ threadId: thread.id,1949+ });1950+ }1951+ }1952+ }1953+1954+ if (1955+ shouldApplyThreadLifecycle &&1956+ event.type === "turn.completed" &&1957+ normalizeRuntimeTurnState(event.payload.state) !== "failed" &&1958+ thread.usageLimitResume != null1959+ ) {1960+ yield* orchestrationEngine.dispatch({1961+ type: "thread.usage-limit-resume.cancel",1962+ commandId: yield* providerCommandId(event, "usage-limit-resume-completed"),1963+ threadId: thread.id,1964+ });
- apps/server/src/orchestration/decider.ts line 959Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -672,0 +904,21 @@904+ type: "thread.usage-limit-resume-cancelled",905+ payload: {906+ threadId: command.threadId,907+ updatedAt: thread.usageLimitResume == null ? thread.updatedAt : occurredAt,908+ },909+ };910+ }911+912+ case "thread.usage-limit-resume.attempt": {913+ const thread = yield* requireThreadNotArchived({914+ readModel,915+ command,916+ threadId: command.threadId,917+ });918+ const current = thread.usageLimitResume ?? null;919+ if (920+ (thread.deletedAt !== null ||921+ thread.settledOverride === "settled" ||922+ !isStoppedByUsageLimit(thread)) &&923+ current !== null924+ ) {
Sign in to join this conversation.





Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
658c7c3a-f1ed-4e41-b96e-9aa91ef5b044You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.