@@ -13,6 +13,7 @@ import * as Option from "effect/Option";
1313import {
1414 isExpiredAgentActivityState ,
1515 isTerminalPhase ,
16+ MAX_ACTIVITY_ROWS ,
1617 sanitizeAgentActivityAggregateState ,
1718} from "./agentActivityPayloads.ts" ;
1819
@@ -228,7 +229,7 @@ function terminalAggregateState(state: RelayAgentActivityState): RelayAgentActiv
228229// How long a finished thread keeps its Done/Failed row in the aggregate while
229230// other agents are still active. Long enough to be seen on the lock screen,
230231// 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 ;
232233
233234function isRecentTerminalState ( state : RelayAgentActivityState , nowMs : number ) : boolean {
234235 if ( ! isTerminalPhase ( state ) ) {
@@ -273,7 +274,7 @@ export function makeAggregateState(input: {
273274 subtitle : newest . phase === "failed" ? "Agent work failed" : "Agent work completed" ,
274275 activeCount : 0 ,
275276 updatedAt : newest . updatedAt ,
276- activities : recentTerminal . slice ( 0 , 3 ) . map ( aggregateRowForState ) ,
277+ activities : recentTerminal . slice ( 0 , MAX_ACTIVITY_ROWS ) . map ( aggregateRowForState ) ,
277278 } ) ;
278279 }
279280 // Recently finished threads ride along after the active ones (display slots
@@ -282,7 +283,10 @@ export function makeAggregateState(input: {
282283 const recentTerminalStates = input . activeStates
283284 . filter ( ( state ) => isRecentTerminalState ( state , input . nowMs ) )
284285 . 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 ) ;
286290 const updatedAt = [ ...activeStates , ...recentTerminalStates ] . reduce ( ( latest , state ) =>
287291 state . updatedAt . localeCompare ( latest . updatedAt ) > 0 ? state : latest ,
288292 ) . updatedAt ;
0 commit comments