@devries-cameron20 / t3code-1 / commits / b6c326d12f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): background compactions no longer flip threads to Working (#25122)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 25, 2026 at 16:18 UTC b6c326d12f0a455a154e89f98b64f337d2d4a4f0
7 files changed +126 -116
apps/server/src/orchestration-v2/ProjectionStore.test.ts
+55 -21
@@ -3193,7 +3193,7 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
3193 ["a normalized idle command", "agent", "server", undefined, true, " \t\u00a0/COMPACT\u3000\n"],
3194 ["an ordinary prompt with idle metadata", "user", "web", "onReturn", false, "Continue"],
3195 ] as const)(
3196 - "marks the shell's latest run silent only for %s",
3196 + "keeps the shell on the user's last turn only during %s",
3197 ([name, createdBy, creationSource, idleCompaction, silent, text]) =>
3198 Effect.gen(function* () {
3199 const projectionStore = yield* ProjectionStore.ProjectionStoreV2;
@@ -3270,23 +3270,62 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
3270 userMessageId: messageId,
3271 rootNodeId: null,
3272 activeAttemptId: null,
3273 - status: "completed",
3273 + status: "running",
3274 requestedAt: now,
3275 startedAt: now,
3276 - completedAt: now,
3276 + completedAt: null,
3277 checkpointId: null,
3278 contextHandoffId: null,
3279 },
3280 });
3281
3282 - const sqlShell = (yield* projectionStore.getShellSnapshot()).threads.find(
3283 - (thread) => thread.id === threadId,
3284 - );
3285 - const memoryShell = ProjectionStore.threadShellFromProjection(
3286 - yield* projectionStore.getThreadProjection(threadId),
3282 + const presented = Effect.gen(function* () {
3283 + const sqlShell = (yield* projectionStore.getShellSnapshot()).threads.find(
3284 + (thread) => thread.id === threadId,
3285 + );
3286 + const memoryShell = ProjectionStore.threadShellFromProjection(
3287 + yield* projectionStore.getThreadProjection(threadId),
3288 + );
3289 + return [sqlShell, memoryShell].map((shell) => ({
3290 + latestRunId: shell?.latestRunId ?? null,
3291 + activityRunStatus: shell?.activityRunStatus ?? null,
3292 + activeRunId: shell?.activeRunId ?? null,
3293 + latestUserMessageAt: shell?.latestUserMessageAt != null,
3294 + }));
3295 + });
3296 + const visible = {
3297 + latestRunId: runId,
3298 + activityRunStatus: "running" as const,
3299 + activeRunId: runId,
3300 + latestUserMessageAt: true,
3301 + };
3302 + const hidden = {
3303 + latestRunId: null,
3304 + activityRunStatus: null,
3305 + activeRunId: null,
3306 + latestUserMessageAt: false,
3307 + };
3308 + assert.deepStrictEqual(yield* presented, [
3309 + silent ? hidden : visible,
3310 + silent ? hidden : visible,
3311 + ]);
3312 +
3313 + // A run that fails outright, e.g. on a provider error, needs the user too.
3314 + const running = (yield* projectionStore.getThreadProjection(threadId)).runs[0]!;
3315 + const setRunStatus = (status: "failed" | "running") =>
3316 + projectionStore.apply({
3317 + id: EventId.make(`event:projection-shell-silent:${key}:run-${status}`),
3318 + type: "run.updated",
3319 + threadId,
3320 + occurredAt: now,
3321 + payload: { ...running, status, completedAt: status === "failed" ? now : null },
3322 + });
3323 + yield* setRunStatus("failed");
3324 + assert.deepStrictEqual(
3325 + (yield* presented).map((shell) => shell.latestRunId),
3326 + [runId, runId],
3327 );
3288 - assert.equal(sqlShell?.latestRunSilent, silent);
3289 - assert.equal(memoryShell.latestRunSilent, silent);
3328 + yield* setRunStatus("running");
3329
3330 // Claude can finish the run successfully even when its /compact failed.
3331 yield* projectionStore.apply({
@@ -3315,17 +3354,12 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
3354 updatedAt: now,
3355 },
3356 });
3318 - assert.equal(
3319 - (yield* projectionStore.getShellSnapshot()).threads.find(
3320 - (thread) => thread.id === threadId,
3321 - )?.latestRunSilent,
3322 - false,
3323 - );
3324 - assert.equal(
3325 - ProjectionStore.threadShellFromProjection(
3326 - yield* projectionStore.getThreadProjection(threadId),
3327 - ).latestRunSilent,
3328 - false,
3357 + // A failure needs the user, so it surfaces even though its prompt stays hidden.
3358 + assert.deepStrictEqual(
3359 + yield* presented,
3360 + [visible, visible].map((shell) =>
3361 + silent ? { ...shell, latestUserMessageAt: false } : shell,
3362 + ),
3363 );
3364 }),
3365 );
apps/server/src/orchestration-v2/ProjectionStore.ts
+70 -48
@@ -1115,7 +1115,6 @@ type ShellThreadRow = {
1115 readonly latest_run_started_at: string | null;
1116 readonly latest_run_completed_at: string | null;
1117 readonly latest_run_stop_requested: number;
1118 - readonly latest_run_silent: number;
1118 readonly active_run_id: string | null;
1119 readonly active_run_status: string | null;
1120 readonly activity_run_status: string | null;
@@ -1573,21 +1572,23 @@ export function threadShellFromProjection(
1572 (left, right) =>
1573 DateTime.toEpochMillis(right.updatedAt) - DateTime.toEpochMillis(left.updatedAt),
1574 )[0] ?? null;
1575 + // T3 Code's own idle compactions stay out of the shell unless they fail, so thread lists,
1576 + // notifications and the relay keep presenting the user's last turn.
1577 + const runs = projection.runs.filter((run) => !isSilentRunForShell(run, projection));
1578 const latestRun =
1579 usageLimitRunPresentedAsLatest(
1578 - projection.runs,
1580 + runs,
1581 projection.turnItems,
1582 providerSession?.lastError ?? null,
1581 - ) ?? latestUnheldRun(projection.runs);
1583 + ) ?? latestUnheldRun(runs);
1584 const activeRun =
1583 - projection.runs
1585 + runs
1586 .filter(isInterruptibleRunForShell)
1587 .toSorted((left, right) => right.ordinal - left.ordinal)[0] ?? null;
1588 const activityRun =
1587 - projection.runs
1588 - .filter(isActivityRunForShell)
1589 - .toSorted((left, right) => right.ordinal - left.ordinal)[0] ?? null;
1590 - const liveRunIds = new Set(projection.runs.filter(isActivityRunForShell).map((run) => run.id));
1589 + runs.filter(isActivityRunForShell).toSorted((left, right) => right.ordinal - left.ordinal)[0] ??
1590 + null;
1591 + const liveRunIds = new Set(runs.filter(isActivityRunForShell).map((run) => run.id));
1592 let pendingRuntimeRequest = pendingRuntimeRequestSummary(
1593 projection.runtimeRequests
1594 .filter((request) => request.status === "pending")
@@ -1614,7 +1615,7 @@ export function threadShellFromProjection(
1615 ) ?? pendingRuntimeRequest;
1616 }
1617 const userMessages = projection.messages
1617 - .filter((message) => message.role === "user")
1618 + .filter((message) => message.role === "user" && idleCompactionOf(message) === undefined)
1619 .toSorted(
1620 (left, right) =>
1621 DateTime.toEpochMillis(right.updatedAt) - DateTime.toEpochMillis(left.updatedAt),
@@ -1625,7 +1626,7 @@ export function threadShellFromProjection(
1626 providerThreads: projection.providerThreads,
1627 turnItems: projection.turnItems,
1628 activeProviderThreadId: projection.thread.activeProviderThreadId,
1628 - runs: projection.runs,
1629 + runs,
1630 pullRequests: projection.thread.pullRequests,
1631 });
1632 return {
@@ -1665,16 +1666,6 @@ export function threadShellFromProjection(
1666 projection.turnItems.some(
1667 (item) => item.runId === latestRun.id && item.type === "run_interrupt_request",
1668 ),
1668 - latestRunSilent:
1669 - latestRun != null &&
1670 - projection.messages.some(
1671 - (message) =>
1672 - message.id === latestRun.userMessageId && idleCompactionOf(message) !== undefined,
1673 - ) &&
1674 - !projection.turnItems.some(
1675 - (item) =>
1676 - item.runId === latestRun.id && item.type === "compaction" && item.status === "failed",
1677 - ),
1669 activeRunId: activeRun?.id ?? null,
1670 blockedOnThreadWait: deriveBlockedOnThreadWait({ activeRun, turnItems: projection.turnItems }),
1671 activityRunStatus: activityRun?.status ?? null,
@@ -1755,6 +1746,21 @@ function activeProviderGoalForShell(
1746 return providerThreads.find((thread) => thread.id === activeProviderThreadId)?.goal ?? null;
1747 }
1748
1749 +function isSilentRunForShell(
1750 + run: OrchestrationV2ThreadProjection["runs"][number],
1751 + projection: Pick<OrchestrationV2ThreadProjection, "messages" | "turnItems">,
1752 +): boolean {
1753 + return (
1754 + run.status !== "failed" &&
1755 + projection.messages.some(
1756 + (message) => message.id === run.userMessageId && idleCompactionOf(message) !== undefined,
1757 + ) &&
1758 + !projection.turnItems.some(
1759 + (item) => item.runId === run.id && item.type === "compaction" && item.status === "failed",
1760 + )
1761 + );
1762 +}
1763 +
1764 function isInterruptibleRunForShell(run: OrchestrationV2ThreadProjection["runs"][number]): boolean {
1765 return run.status === "preparing" || run.status === "starting" || run.status === "running";
1766 }
@@ -1777,7 +1783,6 @@ type ShellThreadState = {
1783 readonly latestRunStartedAt: DateTime.Utc | null;
1784 readonly latestRunCompletedAt: DateTime.Utc | null;
1785 readonly latestRunStopRequested: boolean;
1780 - readonly latestRunSilent: boolean;
1786 readonly activeRunId: RunId | null;
1787 readonly blockedOnThreadWait: boolean;
1788 readonly activityRunStatus: ShellActivityRunStatus | null;
@@ -1933,7 +1938,6 @@ function shellFromState(input: {
1938 latestRunStartedAt: input.state.latestRunStartedAt,
1939 latestRunCompletedAt: input.state.latestRunCompletedAt,
1940 latestRunStopRequested: input.state.latestRunStopRequested,
1936 - latestRunSilent: input.state.latestRunSilent,
1941 activeRunId: input.state.activeRunId,
1942 blockedOnThreadWait: input.state.blockedOnThreadWait,
1943 activityRunStatus: input.state.activityRunStatus,
@@ -5743,6 +5747,43 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5747 ),
5748 );
5749
5750 + // Mirror idleCompactionOf, including JavaScript trim whitespace.
5751 + const isIdleCompactionMessage = (alias: string) => {
5752 + const payload = sql.literal(`${alias}.payload_json`);
5753 + return sql`(
5754 + ${sql.literal(`${alias}.role`)} = 'user'
5755 + AND lower(trim(json_extract(${payload}, '$.text'),
5756 + char(9, 10, 11, 12, 13, 32, 160, 5760, 8192, 8193, 8194, 8195,
5757 + 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288, 65279)
5758 + )) = ${IDLE_COMPACTION_TEXT}
5759 + AND coalesce(json_array_length(${payload}, '$.attachments'), 0) = 0
5760 + AND (
5761 + json_extract(${payload}, '$.idleCompaction') IS NOT NULL
5762 + OR (
5763 + json_extract(${payload}, '$.createdBy') = 'agent'
5764 + AND json_extract(${payload}, '$.creationSource') = 'server'
5765 + )
5766 + )
5767 + )`;
5768 + };
5769 + // Mirrors isSilentRunForShell.
5770 + const isSilentShellRun = (alias: string) => {
5771 + const run = sql.literal(alias);
5772 + return sql`(
5773 + ${run}.status <> 'failed'
5774 + AND EXISTS (
5775 + SELECT 1 FROM orchestration_v2_projection_messages prompt
5776 + WHERE prompt.message_id = json_extract(${run}.payload_json, '$.userMessageId')
5777 + AND ${isIdleCompactionMessage("prompt")}
5778 + ) AND NOT EXISTS (
5779 + SELECT 1 FROM orchestration_v2_projection_turn_items compaction
5780 + WHERE compaction.thread_id = ${run}.thread_id AND compaction.run_id = ${run}.run_id
5781 + AND compaction.type = 'compaction'
5782 + AND compaction.status = 'failed'
5783 + )
5784 + )`;
5785 + };
5786 +
5787 const selectShellThreadRows = (
5788 threadId?: ThreadId,
5789 {
@@ -5773,29 +5814,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5814 WHERE stop_request.thread_id = t.thread_id AND stop_request.run_id = presented.run_id
5815 AND stop_request.type = 'run_interrupt_request'
5816 ) AS latest_run_stop_requested,
5776 - -- Mirrors idleCompactionOf, including JavaScript trim whitespace.
5777 - EXISTS (
5778 - SELECT 1 FROM orchestration_v2_projection_messages prompt
5779 - WHERE prompt.message_id = json_extract(presented.payload_json, '$.userMessageId')
5780 - AND prompt.role = 'user'
5781 - AND lower(trim(json_extract(prompt.payload_json, '$.text'),
5782 - char(9, 10, 11, 12, 13, 32, 160, 5760, 8192, 8193, 8194, 8195,
5783 - 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288, 65279)
5784 - )) = ${IDLE_COMPACTION_TEXT}
5785 - AND coalesce(json_array_length(prompt.payload_json, '$.attachments'), 0) = 0
5786 - AND (
5787 - json_extract(prompt.payload_json, '$.idleCompaction') IS NOT NULL
5788 - OR (
5789 - json_extract(prompt.payload_json, '$.createdBy') = 'agent'
5790 - AND json_extract(prompt.payload_json, '$.creationSource') = 'server'
5791 - )
5792 - )
5793 - ) AND NOT EXISTS (
5794 - SELECT 1 FROM orchestration_v2_projection_turn_items compaction
5795 - WHERE compaction.thread_id = t.thread_id AND compaction.run_id = presented.run_id
5796 - AND compaction.type = 'compaction'
5797 - AND compaction.status = 'failed'
5798 - ) AS latest_run_silent,
5817 active.run_id AS active_run_id,
5818 active.status AS active_run_status,
5819 (
@@ -5803,6 +5821,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5821 FROM orchestration_v2_projection_runs r
5822 WHERE r.thread_id = t.thread_id
5823 AND r.status IN ('preparing', 'starting', 'running', 'waiting')
5824 + AND NOT ${isSilentShellRun("r")}
5825 ORDER BY r.ordinal DESC, r.run_id DESC
5826 LIMIT 1
5827 ) AS activity_run_status,
@@ -5816,6 +5835,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5835 FROM orchestration_v2_projection_runs r
5836 WHERE r.thread_id = t.thread_id
5837 AND r.status IN ('preparing', 'starting', 'running', 'waiting')
5838 + AND NOT ${isSilentShellRun("r")}
5839 ORDER BY r.ordinal DESC, r.run_id DESC
5840 LIMIT 1
5841 ) AS activity_run_started_at,
@@ -5887,6 +5907,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5907 FROM orchestration_v2_projection_messages message
5908 WHERE message.thread_id = t.thread_id
5909 AND message.role = 'user'
5910 + AND NOT ${isIdleCompactionMessage("message")}
5911 ORDER BY message.updated_at DESC, message.message_id DESC
5912 LIMIT 1
5913 ) AS latest_user_message_at,
@@ -5912,6 +5933,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5933 FROM orchestration_v2_projection_runs r
5934 WHERE r.thread_id = t.thread_id
5935 AND r.status IN ('preparing', 'starting', 'running')
5936 + AND NOT ${isSilentShellRun("r")}
5937 ORDER BY r.ordinal DESC, r.run_id DESC
5938 LIMIT 1
5939 )
@@ -5924,6 +5946,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
5946 candidate.status = 'queued'
5947 AND json_extract(candidate.payload_json, '$.queueHeld') IS 1
5948 )
5949 + AND NOT ${isSilentShellRun("candidate")}
5950 ORDER BY candidate.ordinal DESC, candidate.run_id DESC
5951 LIMIT 1
5952 )
@@ -6139,6 +6162,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
6162 SELECT message.updated_at
6163 FROM orchestration_v2_projection_messages message
6164 WHERE message.thread_id = t.thread_id AND message.role = 'user'
6165 + AND NOT ${isIdleCompactionMessage("message")}
6166 ORDER BY message.updated_at DESC, message.message_id DESC
6167 LIMIT 1
6168 ) AS latest_user_message_at,
@@ -6154,6 +6178,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
6178 LEFT JOIN orchestration_v2_projection_runs r ON r.run_id = (
6179 SELECT latest.run_id FROM orchestration_v2_projection_runs latest
6180 WHERE latest.thread_id = t.thread_id
6181 + AND NOT ${isSilentShellRun("latest")}
6182 ORDER BY latest.ordinal DESC, latest.run_id DESC
6183 LIMIT 1
6184 )
@@ -6343,7 +6368,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
6368 ? null
6369 : DateTime.makeUnsafe(row.latest_run_completed_at);
6370 let latestRunStopRequested = row.latest_run_stop_requested === 1;
6346 - let latestRunSilent = row.latest_run_silent === 1;
6371 if (row.blocking_run_id !== null && row.blocking_failure_payload_json !== null) {
6372 const blockingFailure = yield* decodeTurnItemPayload(
6373 row.blocking_failure_payload_json,
@@ -6357,7 +6381,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
6381 terminalFailureItem = blockingFailure;
6382 latestRunId = RunId.make(row.blocking_run_id);
6383 latestRunStopRequested = row.blocking_run_stop_requested === 1;
6360 - latestRunSilent = false;
6384 latestRunStatus = "failed";
6385 latestRunRequestedAt =
6386 row.blocking_run_requested_at === null
@@ -6398,7 +6421,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
6421 latestRunStartedAt,
6422 latestRunCompletedAt,
6423 latestRunStopRequested,
6401 - latestRunSilent,
6424 activeRunId: row.active_run_id === null ? null : RunId.make(row.active_run_id),
6425 blockedOnThreadWait: deriveBlockedOnThreadWait({
6426 activeRun:
apps/web/src/components/ThreadNotificationCoordinator.badge.browser.test.tsx
-24
@@ -81,7 +81,6 @@ const thread = {
81 id: "thread",
82 title: "Test thread",
83 archivedAt: null as string | null,
84 - latestRunSilent: false,
84 hasPendingApprovals: false,
85 hasPendingUserInput: false,
86 session: null as { status: string } | null,
@@ -114,7 +113,6 @@ function toV2ThreadShell(input: typeof thread) {
113 createdBy: "user",
114 creationSource: "web",
115 latestRunId: latestTurn.turnId,
117 - latestRunSilent: input.latestRunSilent,
116 activeRunId: null,
117 status:
118 latestTurn.state === "completed"
@@ -220,28 +218,6 @@ it.each(["hasPendingApprovals", "hasPendingUserInput"] as const)(
218 },
219 );
220
223 -it.each([
224 - ["pre-expiry compaction", true, "completed", []],
225 - ["manual compaction", false, "completed", ["Thread completed"]],
226 - ["failed pre-expiry compaction", true, "error", ["Thread failed"]],
227 -] as const)("notifies for %s only when attention is needed", async (_, silent, status, titles) => {
228 - await using app = setup();
229 - state.environmentIds = ["one"];
230 - state.shells.set("one", shell({ latestRunSilent: silent }));
231 - await using screen = await render(app.ui());
232 - state.shells.set(
233 - "one",
234 - shell({
235 - latestRunSilent: silent,
236 - latestTurn: { turnId: "turn", state: status, completedAt: "2026-09-13T07:01:00.000Z" },
237 - }),
238 - );
239 - using _timers = fakeTimers();
240 - await screen.rerender(app.ui());
241 - await vi.advanceTimersByTimeAsync(WORKING_EXIT_GRACE_MS);
242 - expect(TestNotification.sent.map((notification) => notification.title)).toEqual(titles);
243 -});
244 -
221 it("holds a completion through a continuation gap and notifies once it settles", async () => {
222 await using app = setup();
223 await app.render();
apps/web/src/components/ThreadNotificationCoordinator.tsx
+1 -1
@@ -274,7 +274,7 @@ function EnvironmentNotifications({
274 for (const [prior, state] of changed) {
275 pendingCompletions.observe(state.thread.id, prior, state, {
276 archived: state.thread.archivedAt !== null,
277 - quiet: state.raw.latestRunStopRequested === true || state.raw.latestRunSilent === true,
277 + quiet: state.raw.latestRunStopRequested === true,
278 });
279 }
280 }, [environmentId, threads]);
packages/contracts/src/orchestrationV2.ts
-2
@@ -1916,8 +1916,6 @@ export const OrchestrationV2ThreadShell = Schema.Struct({
1916 latestRunStartedAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtc)),
1917 latestRunCompletedAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtc)),
1918 latestRunStopRequested: Schema.optional(Schema.Boolean),
1919 - /** Suppress routine notifications for idle compaction; failures still notify. */
1920 - latestRunSilent: Schema.optional(Schema.Boolean),
1919 activeRunId: Schema.NullOr(RunId),
1920 activityRunStartedAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtc)),
1921 activityRunStatus: Schema.optional(
packages/shared/src/agentAwareness.test.ts
-14
@@ -63,20 +63,6 @@ describe("projectThreadAwarenessV2", () => {
63 ).toBeNull();
64 });
65
66 - it.each([
67 - ["running", null],
68 - ["completed", null],
69 - ["failed", "failed"],
70 - ] as const)("keeps an idle compaction's %s run quiet unless it fails", (status, phase) => {
71 - expect(
72 - projectThreadAwarenessV2({
73 - environmentId: "env-1" as EnvironmentId,
74 - project,
75 - thread: { ...v2Thread({ status }), latestRunSilent: true },
76 - })?.phase ?? null,
77 - ).toBe(phase);
78 - });
79 -
66 it.each(["running", "completed", "failed"] as const)(
67 "does not publish %s subagent activity",
68 (status) => {
packages/shared/src/agentAwareness.ts
-6
@@ -46,7 +46,6 @@ export interface ProjectThreadAwarenessV2Input {
46 | "id"
47 | "lineage"
48 | "latestRunStopRequested"
49 - | "latestRunSilent"
49 | "modelSelection"
50 | "pendingBackgroundTasks"
51 | "pendingRuntimeRequest"
@@ -67,11 +66,6 @@ export function projectThreadAwarenessV2(
66 return null;
67 }
68 if (phase === "completed" && thread.latestRunStopRequested === true) return null;
70 - if (
71 - thread.latestRunSilent === true &&
72 - (phase === "starting" || phase === "running" || phase === "completed")
73 - )
74 - return null;
69 // Resolve the phase first so live or waiting work stays visible after settlement.
70 if (
71 thread.settledOverride === "settled" &&