@@ -76,42 +76,15 @@ export const LIVE_ACTIVITY_WORDS = [
7676/** How long each live-activity word holds before the next. */
7777export const LIVE_WORD_MS = 4_000 ;
7878
79- /**
80- * Execution → activity-state mapping, kept in this one place with an
81- * explicit fallback so a newly added tool (built-in, MCP, or plugin) renders
82- * a generic "working" state instead of leaking its identifier — no ticker
83- * change is required to add a tool correctly.
84- */
85- const TOOL_ACTIVITY_STATES : Readonly < Record < string , ActivityState > > = {
86- read_file : "grinding" ,
87- search_files : "grinding" ,
88- grep : "grinding" ,
89- list_dir : "grinding" ,
90- web_search : "grinding" ,
91- web_fetch : "grinding" ,
92- write_file : "creating" ,
93- edit_file : "creating" ,
94- run_shell : "creating" ,
95- delete_file : "creating" ,
96- manage_tasks : "imagining" ,
97- task : "imagining" ,
98- tool_search : "grinding" ,
99- search_agents : "grinding" ,
100- ask_operator : "waiting" ,
101- submit_output : "doing" ,
102- } ;
103-
104- function activityStateForTool ( name : string | null ) : ActivityState {
105- if ( name === null ) return "working" ;
106- return TOOL_ACTIVITY_STATES [ name ] ?? "working" ;
107- }
108-
10979function liveActivityWord ( nowMs : number ) : ActivityState {
11080 const index = Math . floor ( nowMs / LIVE_WORD_MS ) % LIVE_ACTIVITY_WORDS . length ;
11181 return LIVE_ACTIVITY_WORDS [ index ] ?? "working" ;
11282}
11383
114- function sessionIsLive ( input : TurnLabelInput , fleet : FleetProgress | null ) : boolean {
84+ function sessionIsLive (
85+ input : TurnLabelInput ,
86+ fleet : FleetProgress | null ,
87+ ) : boolean {
11588 if ( input . isProcessing ) return true ;
11689 if ( input . sessionActive === true ) return true ;
11790 return fleet !== null && fleet . running > 0 ;
@@ -141,20 +114,14 @@ export function resolveTurnLabel(
141114 // Stopping is this parent turn aborting. A settled parent with live
142115 // lanes is still occupied — don't let a leftover stopping status blank
143116 // the lockup or freeze it on "stopping".
144- if ( input . isProcessing && ( input . status === "stopping" || input . status === "stopped" ) ) {
117+ if (
118+ input . isProcessing &&
119+ ( input . status === "stopping" || input . status === "stopped" )
120+ ) {
145121 return "stopping" ;
146122 }
147123 if ( ! occupied ) return undefined ;
148- // Live fleet / parent continuation means the session is working — recovery
149- // is silent. Never paint "stalled" for the operator.
150- const fleetLive = fleet !== null && fleet . running > 0 ;
151- if ( fleetLive || input . sessionActive === true ) {
152- return liveActivityWord ( input . nowMs ?? 0 ) ;
153- }
154124 void isStalled ;
155- if ( input . currentToolName !== null )
156- return activityStateForTool ( input . currentToolName ) ;
157- if ( input . streamingType === "thinking" ) return "thinking" ;
158125 return liveActivityWord ( input . nowMs ?? 0 ) ;
159126}
160127
0 commit comments