fix(server): preserve automatic settlement timestamps #9254
Mergedeimexdev(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/9254/headmerged by juliusmarminge 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:L
- apps/server/src/orchestration/ThreadSettlementPolicy.ts lines 82 to 82OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -71,16 +71,12 @@71-}): boolean {71+}): string | null {7272 const { thread, pullRequest } = input;73- if (!isAutoSettlementCandidate(thread, input.now)) return false;74- if (pullRequest !== null) {75- if (pullRequestSettles(thread, pullRequest, input.autoSettleOnMerge)) return true;76- if (pullRequest.state === "open") return false;77- }78- if (input.autoSettleAfterDays === null) return false;73+ if (!isAutoSettlementCandidate(thread, input.now)) return null;7974 const activityAt = latestTimestamp([8075 thread.latestUserMessageAt,8176 thread.latestTurn?.requestedAt,8277 thread.latestTurn?.startedAt,8378 thread.latestTurn?.completedAt,8479 ]);85- if (activityAt === null) return false;86- return Date.parse(activityAt) < Date.parse(input.now) - input.autoSettleAfterDays * DAY_MS;80+ if (pullRequest !== null) {81+ if (pullRequestSettles(thread, pullRequest, input.autoSettleOnMerge)) {82+ return activityAt ?? thread.updatedAt;
- docs/user/thread-sidebar.md lines 19 to 20OutdatedResolvedby eimexdev(GitHub profile, opens in a new tab)@@ -16,4 +16,5 @@1616 request closes. An open pull request blocks inactivity settlement. Active work, pending input, and1717 live background work keep the thread active. T3 Code settles from a closed or merged pull request1818 only when its timestamp is not older than the user's latest activity. If that timestamp is not19-available, the inactivity rule still applies. A manual un-settle also keeps the thread active.19+available, the inactivity rule still applies. Automatically settled threads keep their last20+activity time for ordering in **Settled**. A manual un-settle also keeps the thread active.apps/server/src/orchestration/ThreadSettlementPolicy.ts line 82OutdatedResolvedby eimexdev(GitHub profile, opens in a new tab)@@ -71,16 +71,12 @@71-}): boolean {71+}): string | null {7272 const { thread, pullRequest } = input;73- if (!isAutoSettlementCandidate(thread, input.now)) return false;74- if (pullRequest !== null) {75- if (pullRequestSettles(thread, pullRequest, input.autoSettleOnMerge)) return true;76- if (pullRequest.state === "open") return false;77- }78- if (input.autoSettleAfterDays === null) return false;73+ if (!isAutoSettlementCandidate(thread, input.now)) return null;7974 const activityAt = latestTimestamp([8075 thread.latestUserMessageAt,8176 thread.latestTurn?.requestedAt,8277 thread.latestTurn?.startedAt,8378 thread.latestTurn?.completedAt,8479 ]);85- if (activityAt === null) return false;86- return Date.parse(activityAt) < Date.parse(input.now) - input.autoSettleAfterDays * DAY_MS;80+ if (pullRequest !== null) {81+ if (pullRequestSettles(thread, pullRequest, input.autoSettleOnMerge)) {82+ return activityAt ?? thread.updatedAt;
- apps/server/src/orchestration/ThreadSettlementPolicy.ts line 82OutdatedResolvedby eimexdev(GitHub profile, opens in a new tab)@@ -71,16 +71,12 @@71-}): boolean {71+}): string | null {7272 const { thread, pullRequest } = input;73- if (!isAutoSettlementCandidate(thread, input.now)) return false;74- if (pullRequest !== null) {75- if (pullRequestSettles(thread, pullRequest, input.autoSettleOnMerge)) return true;76- if (pullRequest.state === "open") return false;77- }78- if (input.autoSettleAfterDays === null) return false;73+ if (!isAutoSettlementCandidate(thread, input.now)) return null;7974 const activityAt = latestTimestamp([8075 thread.latestUserMessageAt,8176 thread.latestTurn?.requestedAt,8277 thread.latestTurn?.startedAt,8378 thread.latestTurn?.completedAt,8479 ]);85- if (activityAt === null) return false;86- return Date.parse(activityAt) < Date.parse(input.now) - input.autoSettleAfterDays * DAY_MS;80+ if (pullRequest !== null) {81+ if (pullRequestSettles(thread, pullRequest, input.autoSettleOnMerge)) {82+ return activityAt ?? thread.updatedAt;
juliusmarminge merged this2971ec3
juliusmarminge closed this
Sign in to join this conversation.


Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
71940bca77a10dℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.