Surface runtime output in launch errors

This commit is contained in:
Shantur Rathore
2025-12-25 20:44:21 +00:00
parent 2603b1d260
commit 3e4d51c9f2
2 changed files with 35 additions and 7 deletions

View File

@@ -306,9 +306,11 @@ export class WorkspaceManager {
}
const latestOutput = params.getLastOutput().trim()
const outputDetails = latestOutput ? ` Last output: ${latestOutput}` : ""
if (latestOutput) {
throw new Error(latestOutput)
}
const reason = probeResult.reason ?? "Health check failed"
throw new Error(`Workspace ${params.workspaceId} failed health check: ${reason}.${outputDetails}`)
throw new Error(`Workspace ${params.workspaceId} failed health check: ${reason}.`)
}
private async probeInstance(workspaceId: string, port: number): Promise<{ ok: boolean; reason?: string }> {