fix(cli): Couldn't wake state for a failed wake (glossary update)

This commit is contained in:
Neil
2026-11-10 02:37:52 -08:00
parent 90a60ed16a
commit f5d327f502
2 changed files with 15 additions and 4 deletions
+11 -3
View File
@@ -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<CloudWorkspace, 'status' | 'archived'>): 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<CloudWorkspace, 'status' | 'archived'> & { 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':
+4 -1
View File
@@ -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"