diff --git a/frontend/src/components/tasks/TaskDetailsPanel.tsx b/frontend/src/components/tasks/TaskDetailsPanel.tsx index 866af837..3c6537cd 100644 --- a/frontend/src/components/tasks/TaskDetailsPanel.tsx +++ b/frontend/src/components/tasks/TaskDetailsPanel.tsx @@ -506,11 +506,15 @@ export function TaskDetailsPanel({ } const isSetupRunning = executionState.execution_state === 'SetupRunning'; + const isSetupComplete = executionState.execution_state === 'SetupComplete'; const isSetupFailed = executionState.execution_state === 'SetupFailed'; const isCodingAgentRunning = executionState.execution_state === 'CodingAgentRunning'; const isCodingAgentComplete = executionState.execution_state === 'CodingAgentComplete'; + const isCodingAgentFailed = + executionState.execution_state === 'CodingAgentFailed'; + const isComplete = executionState.execution_state === 'Complete'; const hasChanges = executionState.has_changes; // When setup script is running, show setup execution stdio @@ -548,14 +552,100 @@ export function TaskDetailsPanel({ ); } - // When setup failed, show error message + // When setup failed, show error message and stderr if (isSetupFailed) { + const setupProcess = executionState.setup_process_id + ? attemptData.runningProcessDetails[executionState.setup_process_id] + : Object.values(attemptData.runningProcessDetails).find( + (process) => process.process_type === 'setupscript' + ); + return (
-
-

Setup Script Failed

+
+

+ Setup Script Failed +

+

+ The setup script encountered an error. Error details below: +

+
+ + {setupProcess && ( +
+ {(() => { + const stderr = setupProcess.stderr || ''; + const stdout = setupProcess.stdout || ''; + const combined = [stderr, stdout].filter(Boolean).join('\n'); + return combined || 'No error output available'; + })()} +
+ )} +
+ ); + } + + // When coding agent failed, show error message and stderr + if (isCodingAgentFailed) { + const codingAgentProcess = executionState.coding_agent_process_id + ? attemptData.runningProcessDetails[ + executionState.coding_agent_process_id + ] + : Object.values(attemptData.runningProcessDetails).find( + (process) => process.process_type === 'codingagent' + ); + + return ( +
+
+

+ Coding Agent Failed +

+

+ The coding agent encountered an error. Error details below: +

+
+ + {codingAgentProcess && ( +
+ {(() => { + const stderr = codingAgentProcess.stderr || ''; + const stdout = codingAgentProcess.stdout || ''; + const combined = [stderr, stdout].filter(Boolean).join('\n'); + return combined || 'No error output available'; + })()} +
+ )} +
+ ); + } + + // When setup is complete but coding agent hasn't started, show waiting state + if ( + isSetupComplete && + !isCodingAgentRunning && + !isCodingAgentComplete && + !isCodingAgentFailed && + !hasChanges + ) { + return ( +
+
+

Setup Complete

+

Waiting for coding agent to start...

+
+
+ ); + } + + // When task is complete, show completion message + if (isComplete) { + return ( +
+
+

Task Complete

- The setup script encountered an error. Check the logs for details. + The task has been completed successfully.