$ cd packages/sdk && npx vitest run tests/direct-run-worker-lease.test.ts

 RUN  v2.1.9 /Users/khaliqgant/Projects/AgentWorkforce/flows/packages/sdk

 ❯ tests/direct-run-worker-lease.test.ts (2 tests | 1 failed) 7ms
   × direct run handles LLM errors with leaseLost=true 4ms
     → expected '{"ok":false,"command":"run","resoluti…' to contain 'connection closed'

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  tests/direct-run-worker-lease.test.ts > direct run handles LLM errors with leaseLost=true
AssertionError: expected '{"ok":false,"command":"run","resoluti…' to contain 'connection closed'

Expected: "connection closed"
Received: "{"ok":false,"command":"run","resolutions":[],"diagnostics":[{"severity":"failure","kind":"protocol_error","message":"relayflowd could not complete the run request: lease_conflict: lost"}],"path":"flow.ts","socketPath":"/var/folders/6d/0x5fkt8d01gfmmjdzkxqzwnh0000gn/T/relayflowd-4d1d0e012c91.sock"}"

 ❯ tests/direct-run-worker-lease.test.ts:33:41
     31|   const result = await runDirectFlow('flow.ts', '{}', '/unused', { loc…
     32|   expect(result.exitCode).toBe(1);
     33|   expect(JSON.stringify(result.report)).toContain(leaseLost ? 'connect…
       |                                         ^
     34| });
     35| 

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed (1)
      Tests  1 failed | 1 passed (2)
   Start at  00:14:32
   Duration  707ms (transform 284ms, setup 0ms, collect 519ms, tests 7ms, environment 0ms, prepare 42ms)


Exit code: 1
