From 42ac315d8735017a4dba71412094b3a6e37b4ef3 Mon Sep 17 00:00:00 2001 From: Adam Weidman Date: Tue, 12 May 2026 14:35:28 -0400 Subject: [PATCH] refactor(core): use SubagentState enum in RemoteSessionInvocation --- packages/core/src/agents/remote-session-invocation.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/core/src/agents/remote-session-invocation.ts b/packages/core/src/agents/remote-session-invocation.ts index bf9d557ea6..77765cfd7d 100644 --- a/packages/core/src/agents/remote-session-invocation.ts +++ b/packages/core/src/agents/remote-session-invocation.ts @@ -17,6 +17,7 @@ import { type RemoteAgentDefinition, type AgentInputs, type SubagentProgress, + SubagentState, } from './types.js'; import { type AgentLoopContext } from '../config/agent-loop-context.js'; import type { MessageBus } from '../confirmation-bus/message-bus.js'; @@ -139,13 +140,13 @@ export class RemoteSessionInvocation extends BaseToolInvocation< updateOutput({ isSubagentProgress: true, agentName, - state: 'running', + state: SubagentState.RUNNING, recentActivity: [ { id: 'pending', type: 'thought', content: 'Working...', - status: 'running', + status: SubagentState.RUNNING, }, ], }); @@ -164,7 +165,7 @@ export class RemoteSessionInvocation extends BaseToolInvocation< const errorProgress: SubagentProgress = { isSubagentProgress: true, agentName, - state: 'error', + state: SubagentState.ERROR, result: typeof partialProgress?.result === 'string' ? partialProgress.result @@ -199,7 +200,7 @@ export class RemoteSessionInvocation extends BaseToolInvocation< const errorProgress: SubagentProgress = { isSubagentProgress: true, agentName, - state: 'error', + state: SubagentState.ERROR, result: fullDisplay, recentActivity: partialProgress?.recentActivity ?? [], };