Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(queueAdapter): add test for synchronous idle-thread message handling

Steven Enamakel89af8f034293
diff --git a/app/src/features/conversations/aui/queueAdapter.test.tsx b/app/src/features/conversations/aui/queueAdapter.test.tsx
index 2955bc804d..31d83be61c 100644
--- a/app/src/features/conversations/aui/queueAdapter.test.tsx
+++ b/app/src/features/conversations/aui/queueAdapter.test.tsx
@@ -57,7 +57,16 @@ describe('buildOpenHumanQueueAdapter', () => {
await waitFor(() => expect(send).toHaveBeenCalledTimes(1));
});
- it('hands the message to the host after the current task, not synchronously', async () => {
+ it('sends an idle-thread message straight through, synchronously (as onNew did)', () => {
+ const send = vi.fn().mockResolvedValue(undefined);
+ const adapter = buildOpenHumanQueueAdapter({ items: [], send, remove: vi.fn() });
+
+ adapter.enqueue(append('idle'));
+
+ expect(send).toHaveBeenCalledTimes(1);
+ });
+
+ it('hands a mid-run message to the host after the current task, not synchronously', async () => {
const send = vi.fn().mockResolvedValue(undefined);
const adapter = buildOpenHumanQueueAdapter({ items: [], send, remove: vi.fn() });