Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): settling a usage-limited thread disarms recovery and names the refusal #28360

MergedEhsanulHaqueSiam(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/28360/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 44 additions and 1 deletion.

x
0 of 2 viewed, 2 left
11 additions and 1 deletionapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -4476,10 +4476,16 @@
cause: "The reset time has passed. Retry the thread manually.",
+ if (thread.settledOverride === "settled") {
+ return yield* new OrchestratorDispatchError({
+ commandId: command.commandId,
+ commandType: command.type,
+ cause: "The thread is settled. Un-settle it to resume at the reset.",
+ });
+ }
!Number.isFinite(resetMs) ||
thread.archivedAt !== null ||
- thread.settledOverride === "settled" ||
run?.id !== command.limitRecovery.runId ||
failure?.class !== "usage_limit" ||
failure.resetAt !== command.limitRecovery.resetAt ||
@@ -4599,6 +4605,10 @@
...thread,
settledOverride: "settled",
settledAt: alreadySettled ? thread.settledAt : (command.settledAt ?? now),
+ // Settled threads refuse recovery, so an armed resume would stay hidden until un-settled.
+ limitRecovery: thread.limitRecovery
+ ? { ...thread.limitRecovery, autoResume: false, snooze: false }
+ : thread.limitRecovery,
pullRequests: thread.pullRequests?.map((link) => withPullRequestWatch(link, undefined)),
unsettledAt: null,
pinnedAt: null,