From f5d327f5029664bfc46029e30f8a79df778d41b7 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 02:37:52 -0800 Subject: [PATCH] fix(cli): Couldn't wake state for a failed wake (glossary update) --- src/cli/cloud/cloud-format.ts | 14 +++++++++++--- src/cli/cloud/cloud-glossary.test.ts | 5 ++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/cli/cloud/cloud-format.ts b/src/cli/cloud/cloud-format.ts index 84d65ee351e..bd131d403c4 100644 --- a/src/cli/cloud/cloud-format.ts +++ b/src/cli/cloud/cloud-format.ts @@ -116,15 +116,23 @@ export function table(header: string[], rows: string[][]): string { /** "Sandbox size: 8 vCPU · 16 GB". There is one size; it always comes from ORCA_CLOUD_SANDBOX_SPEC. */ export const CLOUD_SANDBOX_SIZE_LINE = `Sandbox size: ${ORCA_CLOUD_SANDBOX_SPEC.vcpus} vCPU · ${ORCA_CLOUD_SANDBOX_SPEC.memoryGb} GB` -/** The API's workspace status in glossary words (Starting, Running, Asleep, Waking, …). */ -export function cloudWorkspaceStateLabel(w: Pick): string { +/** + * The API's workspace status in glossary words (Starting, Running, Asleep, Waking, …). A failed + * wake leaves the workspace asleep with lastError resume_failed: that is "Couldn't wake". + */ +export function cloudWorkspaceStateLabel( + w: Pick & { lastError?: string | null } +): string { switch (w.status) { case 'starting': return 'Starting' case 'running': return 'Running' case 'sleeping': - return w.archived ? 'Archived' : 'Asleep' + if (w.archived) { + return 'Archived' + } + return w.lastError === 'resume_failed' ? "Couldn't wake" : 'Asleep' case 'waking': return 'Waking' case 'destroying': diff --git a/src/cli/cloud/cloud-glossary.test.ts b/src/cli/cloud/cloud-glossary.test.ts index 6d1880dc14a..c525368f1b5 100644 --- a/src/cli/cloud/cloud-glossary.test.ts +++ b/src/cli/cloud/cloud-glossary.test.ts @@ -99,6 +99,9 @@ describe('workspace states and output', () => { expect(label('waking')).toBe('Waking') expect(label('failed')).toBe("Couldn't start") expect(label('destroying')).toBe('Deleting') + expect( + cloudWorkspaceStateLabel({ status: 'sleeping', archived: false, lastError: 'resume_failed' }) + ).toBe("Couldn't wake") }) it('lists ID NAME STATE REPO BRANCH LAST ACTIVE, falling back to updatedAt', () => { @@ -123,7 +126,7 @@ describe('workspace states and output', () => { { workspace: workspace({ status: 'sleeping', lastError: 'resume_failed' }) }, NOW ) - expect(text).toContain('State: Asleep') + expect(text).toContain("State: Couldn't wake") expect(text).toContain('Sandbox size: 8 vCPU · 16 GB') expect(text).toContain( "The last wake didn't finish. Your files are safe. Run: orca cloud workspace wake sbx_aa11"