fix(cli): preserve runtime recovery steps (#24800)

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
This commit is contained in:
Wooseong Kim
2026-10-23 19:20:30 -07:00
committed by GitHub
co-authored by Neil
parent 339397829e
commit fea8bb7f5b
2 changed files with 93 additions and 5 deletions
+10 -2
View File
@@ -76,7 +76,7 @@ export function formatCliError(error: unknown, context: CliErrorContext = {}): s
if (hasOrchestrationRequestId(error.data)) {
return message
}
return `${message}\nOrca is not running. Run 'orca open' first.`
return formatRuntimeUnavailableError(message, error.data)
}
// Match before generic recovery; flattened errors may retain only the conflict token.
const conflict = automationOwnerConflictRecovery(matchAutomationOwnerConflict(error))
@@ -103,7 +103,7 @@ export function formatCliError(error: unknown, context: CliErrorContext = {}): s
error instanceof RuntimeRpcFailureError &&
error.response.error.code === 'runtime_unavailable'
) {
return `${message}\nOrca is not running. Run 'orca open' first.`
return formatRuntimeUnavailableError(message, error.response.error.data)
}
if (error instanceof RuntimeRpcFailureError) {
return formatMessageWithNextSteps(message, nextStepsFromData(error.response.error.data))
@@ -119,6 +119,14 @@ function hasOrchestrationRequestId(data: unknown): boolean {
)
}
function formatRuntimeUnavailableError(message: string, data: unknown): string {
const nextSteps = nextStepsFromData(data)
if (nextSteps.length > 0) {
return formatMessageWithNextSteps(message, nextSteps)
}
return `${message}\nOrca is not running. Run 'orca open' first.`
}
export function reportCliError(error: unknown, json: boolean, context: CliErrorContext = {}): void {
const selector = contextRecovery(errorCode(error), context)
if (json) {