From 2ef1f74bcd6bf5e1f5de0dd8ff96f0464a2c55b5 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Fri, 13 Nov 2026 13:55:23 -0500 Subject: [PATCH] test: read the failed reuse start's dispatch without a cast --- .../worker/start/failed-worker-start-report.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/runtime/rpc/methods/orchestration/worker/start/failed-worker-start-report.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/start/failed-worker-start-report.test.ts index 0ac7a8ec392..ba0dceae158 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/start/failed-worker-start-report.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/start/failed-worker-start-report.test.ts @@ -62,17 +62,18 @@ describe('a worker-start that fails', () => { exitCode: null }) const task = h.db.createTask({ spec: 'follow up on the PR', runId: h.activeRunId }) - const receipt = (await h.call('orchestration.workerStart', { + const receipt = await h.call('orchestration.workerStart', { task: task.id, from: 'term_coord', terminal: 'term_reused' - })) as { state: string; dispatchId: string } - expect(receipt.state).toBe('failed') + }) + expect(receipt).toMatchObject({ state: 'failed' }) + const dispatchId = h.db.getDispatchContext(task.id)?.id const [lost] = h.db.getUnreadRunMailbox(h.activeRunId, 100, ['escalation']) expect(lost?.body).not.toContain('worker-read') await expect( - h.call('orchestration.workerRead', { dispatch: receipt.dispatchId }) + h.call('orchestration.workerRead', { dispatch: dispatchId }) ).rejects.toMatchObject({ code: 'worker_never_started', message: expect.stringContaining('never started: Agent did not become ready')