@devries-cameron20 / t3code Mirror · read-only / commits / 6e42231cb1
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 21:30 UTC

Extend Done display to 15 minutes and show up to 5 Live Activity banner rows (#3761)

Julius Marminge committed Jul 7, 2026 at 02:00 UTC 6e42231cb1da130069cbc694f9da4a185067a81f
4 files changed +25 -10
infra/relay/src/agentActivity/AgentActivityPublisher.test.ts
+13 -4
@@ -736,7 +736,7 @@ describe("makeAggregateState", () => {
736 ...state,
737 threadId: "thread-done" as RelayAgentActivityState["threadId"],
738 phase: "completed",
739 - updatedAt: "1970-01-01T00:50:00.000Z",
739 + updatedAt: "1970-01-01T00:44:00.000Z",
740 };
741 const aggregate = AgentActivityPublisher.makeAggregateState({
742 activeStates: [active, staleCompleted],
@@ -769,7 +769,7 @@ describe("makeAggregateState", () => {
769 });
770 expect(
771 AgentActivityPublisher.makeAggregateState({
772 - activeStates: [{ ...lingeringCompleted, updatedAt: "1970-01-01T00:50:00.000Z" }],
772 + activeStates: [{ ...lingeringCompleted, updatedAt: "1970-01-01T00:44:00.000Z" }],
773 terminalState: null,
774 nowMs: hourMs,
775 }),
@@ -789,16 +789,25 @@ describe("makeAggregateState", () => {
789 updatedAt: "1970-01-01T00:59:00.000Z",
790 };
791 const aggregate = AgentActivityPublisher.makeAggregateState({
792 - activeStates: [mkActive("a-1"), mkActive("a-2"), mkActive("a-3"), justCompleted],
792 + activeStates: [
793 + mkActive("a-1"),
794 + mkActive("a-2"),
795 + mkActive("a-3"),
796 + mkActive("a-4"),
797 + mkActive("a-5"),
798 + justCompleted,
799 + ],
800 terminalState: null,
801 nowMs: hourMs,
802 });
803
797 - expect(aggregate?.activeCount).toBe(3);
804 + expect(aggregate?.activeCount).toBe(5);
805 expect(aggregate?.activities).toMatchObject([
806 { threadId: "a-1" },
807 { threadId: "a-2" },
808 { threadId: "a-3" },
809 + { threadId: "a-4" },
810 + { threadId: "a-5" },
811 ]);
812 });
813 });
infra/relay/src/agentActivity/AgentActivityPublisher.ts
+7 -3
@@ -13,6 +13,7 @@ import * as Option from "effect/Option";
13 import {
14 isExpiredAgentActivityState,
15 isTerminalPhase,
16 + MAX_ACTIVITY_ROWS,
17 sanitizeAgentActivityAggregateState,
18 } from "./agentActivityPayloads.ts";
19
@@ -228,7 +229,7 @@ function terminalAggregateState(state: RelayAgentActivityState): RelayAgentActiv
229 // How long a finished thread keeps its Done/Failed row in the aggregate while
230 // other agents are still active. Long enough to be seen on the lock screen,
231 // short enough that the activity list stays about live work.
231 -export const TERMINAL_AGENT_ACTIVITY_DISPLAY_TTL_MS = 5 * 60 * 1_000;
232 +export const TERMINAL_AGENT_ACTIVITY_DISPLAY_TTL_MS = 15 * 60 * 1_000;
233
234 function isRecentTerminalState(state: RelayAgentActivityState, nowMs: number): boolean {
235 if (!isTerminalPhase(state)) {
@@ -273,7 +274,7 @@ export function makeAggregateState(input: {
274 subtitle: newest.phase === "failed" ? "Agent work failed" : "Agent work completed",
275 activeCount: 0,
276 updatedAt: newest.updatedAt,
276 - activities: recentTerminal.slice(0, 3).map(aggregateRowForState),
277 + activities: recentTerminal.slice(0, MAX_ACTIVITY_ROWS).map(aggregateRowForState),
278 });
279 }
280 // Recently finished threads ride along after the active ones (display slots
@@ -282,7 +283,10 @@ export function makeAggregateState(input: {
283 const recentTerminalStates = input.activeStates
284 .filter((state) => isRecentTerminalState(state, input.nowMs))
285 .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
285 - const displayedStates = [...activeStates.slice(0, 3), ...recentTerminalStates].slice(0, 3);
286 + const displayedStates = [
287 + ...activeStates.slice(0, MAX_ACTIVITY_ROWS),
288 + ...recentTerminalStates,
289 + ].slice(0, MAX_ACTIVITY_ROWS);
290 const updatedAt = [...activeStates, ...recentTerminalStates].reduce((latest, state) =>
291 state.updatedAt.localeCompare(latest.updatedAt) > 0 ? state : latest,
292 ).updatedAt;
infra/relay/src/agentActivity/ApnsDeliveries.test.ts
+2 -2
@@ -373,7 +373,7 @@ describe("ApnsDeliveries", () => {
373 ...aggregate,
374 title: longTitle,
375 subtitle: longTitle,
376 - activities: [0, 1, 2, 3].map((index) =>
376 + activities: [0, 1, 2, 3, 4, 5].map((index) =>
377 Object.assign({}, aggregate.activities[0]!, {
378 projectTitle: longTitle,
379 threadTitle: longTitle,
@@ -396,7 +396,7 @@ describe("ApnsDeliveries", () => {
396 const payloadAggregate = queuedJobs[0]?.payload.aggregate;
397 expect(payloadAggregate?.title.length).toBeLessThanOrEqual(120);
398 expect(payloadAggregate?.subtitle.length).toBeLessThanOrEqual(120);
399 - expect(payloadAggregate?.activities).toHaveLength(3);
399 + expect(payloadAggregate?.activities).toHaveLength(5);
400 expect(payloadAggregate?.activities[0]?.projectTitle.length).toBeLessThanOrEqual(120);
401 expect(payloadAggregate?.activities[0]?.status.length).toBeLessThanOrEqual(40);
402 expect(payloadAggregate?.activities[0]?.deepLink).toBe("/");
infra/relay/src/agentActivity/agentActivityPayloads.ts
+3 -1
@@ -43,7 +43,9 @@ export function isExpiredAgentActivityState(
43 const MAX_SUMMARY_TEXT_LENGTH = 120;
44 const MAX_STATUS_TEXT_LENGTH = 40;
45 const MAX_DEEP_LINK_LENGTH = 512;
46 -const MAX_ACTIVITY_ROWS = 3;
46 +// The Live Activity banner (lock screen / Notification Center) renders up to
47 +// five rows; the expanded Dynamic Island shows the top three of these.
48 +export const MAX_ACTIVITY_ROWS = 5;
49
50 function truncateText(value: string, maxLength: number): string {
51 const trimmed = value.trim();