mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
fix(cli): Couldn't wake state for a failed wake (glossary update)
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user