mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
test(agent-session): let delivery park before the attention case's idle sweep
The single idle-sweep tick keeps a chat whose delivery loop is still running, and the loop parks only after SQL reads that follow the second send's completion event. When the tick ran first it touched the session instead of retiring it, and the 1 s hasSession poll failed. Wait for the loop to park (wake resolves when it does), as goal-steering does. With an 8 ms SQL reply delay injected locally plus CPU load: old 2/5 failed (expected true to be false), new 5/5 passed.
This commit is contained in:
+2
@@ -206,6 +206,8 @@ it('acknowledges a post-rewind completion after normal idle retirement without r
|
||||
...origin,
|
||||
scope: { ...origin.scope, workspaceId: 'another-workspace' }
|
||||
})
|
||||
// The idle sweep keeps a chat whose delivery loop has not parked after the second send.
|
||||
await rig.host.collaboratorsForTests().conversationDelivery.loop.wake(SESSION)
|
||||
rig.clock.now += IDLE_MS + 1
|
||||
await sweepOnce(rig.host)
|
||||
await vi.waitFor(() => expect(rig.host.hasSession(SESSION)).toBe(false))
|
||||
|
||||
Reference in New Issue
Block a user