fix(orchestrator): complete remaining high/medium priority fixes

Backend (orchestrator-routes.ts):
- Added broadcastExecutionStatusMessage helper for specific message types
- Added EXECUTION_PAUSED, EXECUTION_RESUMED, EXECUTION_STOPPED broadcasts
- Added CLI_SESSION_UNLOCKED broadcast on execution completion/failure
- Added sessionKey to ExecutionState interface for tracking
- Added totalSteps to EXECUTION_STARTED WebSocket message

Frontend (executionMonitorStore.ts):
- Added EXECUTION_FAILED message type handling
- Added totalSteps extraction from EXECUTION_STARTED payload
- Implemented pauseExecution, resumeExecution, stopExecution API calls
- Replaced TODO console.log with actual fetch API calls

Frontend (useWebSocket.ts):
- Added import for executionMonitorStore
- Added EXECUTION_* message routing to executionMonitorStore
This commit is contained in:
catlog22
2026-02-20 22:25:00 +08:00
parent ca1a3fca83
commit 87634740a3
3 changed files with 131 additions and 12 deletions

View File

@@ -13,6 +13,10 @@ import {
handleSessionLockedMessage,
handleSessionUnlockedMessage,
} from '@/stores/sessionManagerStore';
import {
useExecutionMonitorStore,
type ExecutionWSMessage,
} from '@/stores/executionMonitorStore';
import {
OrchestratorMessageSchema,
type OrchestratorWebSocketMessage,
@@ -330,6 +334,13 @@ export function useWebSocket(options: UseWebSocketOptions = {}): UseWebSocketRet
return;
}
// Handle EXECUTION messages (from orchestrator execution-in-session)
if (data.type?.startsWith('EXECUTION_')) {
const handleExecutionMessage = useExecutionMonitorStore.getState().handleExecutionMessage;
handleExecutionMessage(data as ExecutionWSMessage);
return;
}
// Handle A2UI surface messages
if (data.type === 'a2ui-surface') {
const parsed = SurfaceUpdateSchema.safeParse(data.payload);