From 44a5751d7227479590efd2971bf12647fdc232e1 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Mon, 28 Sep 2026 03:01:26 -0400 Subject: [PATCH] test(native-chat): await the async history and journal snapshot in three tests #22835 made history() and journalSnapshot() async; tests from #23502 and #22944 still call them synchronously, so the typecheck job is red on every PR while main pushes do not run it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- src/main/codex/codex-structured-question-order.test.ts | 2 +- .../structured-agent-session-accept-then-deliver.test.ts | 4 ++-- ...tructured-agent-session-send-restarts-failed-start.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/codex/codex-structured-question-order.test.ts b/src/main/codex/codex-structured-question-order.test.ts index 35758327076b..ff9a210e17ad 100644 --- a/src/main/codex/codex-structured-question-order.test.ts +++ b/src/main/codex/codex-structured-question-order.test.ts @@ -97,7 +97,7 @@ beforeEach(async () => { now: () => (clock += 1) }) expect((await host.attach(CALLER, hostTestAttachParams(null))).ok).toBe(true) - const page = host.history({ sessionId: SESSION, direction: 'tail' }) + const page = await host.history({ sessionId: SESSION, direction: 'tail' }) if (!page.ok) { throw new Error('no history page') } diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-accept-then-deliver.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-accept-then-deliver.test.ts index d075dc06477c..c8cd54ab4f8e 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-accept-then-deliver.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-accept-then-deliver.test.ts @@ -334,9 +334,9 @@ describe('a start the chat needed and did not get', () => { acquire.mockRejectedValueOnce(new Error('spawn codex ENOENT')) const first = await accept('first') const second = await accept('second') - await eventually(() => expect(submission(second)?.dispatchState).toBe('rejected')) + await eventually(async () => expect((await submission(second))?.dispatchState).toBe('rejected')) - const snapshot = host.journalSnapshot(SESSION) + const snapshot = await host.journalSnapshot(SESSION) const errorRow = snapshot.items.find( (item) => item.body.kind === 'status' && item.body.tone === 'error' )?.itemId diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-send-restarts-failed-start.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-send-restarts-failed-start.test.ts index db1d7a376633..5f6e541ae64f 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-send-restarts-failed-start.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-send-restarts-failed-start.test.ts @@ -211,7 +211,7 @@ describe('a send into a published session whose child ended before startup', () expect.stringMatching(/stopped before it finished starting: .*not signed in/) ]) // Accepted before the restart it needed, so the chat draws it above the row naming the cause. - const snapshot = host.journalSnapshot(SESSION) + const snapshot = await host.journalSnapshot(SESSION) const causeRow = snapshot.items.findLast((item) => item.body.kind === 'status')?.itemId const shown = [agentJournalSubmissionKey(held), causeRow] expect(