fix: tighten CLI contract validation (#3874)

This commit is contained in:
Jinjing
2026-05-30 12:55:47 -07:00
committed by GitHub
parent 8484830b9e
commit ffbc4c3cfb
13 changed files with 394 additions and 27 deletions
+3 -1
View File
@@ -111,8 +111,10 @@ export class RuntimeClient {
id: response.id,
ok: true,
result: {
// Why: remote status proves the paired runtime is reachable, not
// that this client machine has a local Orca desktop process.
app: {
running: true,
running: false,
pid: null
},
runtime: {
@@ -74,6 +74,7 @@ describe('CLI remote WebSocket transport', () => {
const client = new RuntimeClient('/tmp/unused', 5_000, barePayload)
const status = await client.getCliStatus()
expect(status.result.app).toEqual({ running: false, pid: null })
expect(status.result.runtime.reachable).toBe(true)
expect(status.result.runtime.runtimeId).toBe('runtime-ws-2')
})
@@ -95,6 +96,7 @@ describe('CLI remote WebSocket transport', () => {
const client = new RuntimeClient(userDataPath, 5_000, null, 'remote-dev')
const status = await client.getCliStatus()
expect(status.result.app).toEqual({ running: false, pid: null })
expect(status.result.runtime.reachable).toBe(true)
expect(status.result.runtime.runtimeId).toBe('runtime-env-1')
})