Open History to see the last commit
1import { test, expect } from './fixtures'
2
3/**
4 * Claude calls a server tool, then a client tool that interrupts the run. With
5 * `withPersistence`, resuming the run must send and store each tool result
6 * once. `/api/client-tool-resume-store` runs the turn and its resume and
7 * returns what Claude received and what the store kept.
8 */
9test.describe('client tool resume — tool results in the store', () => {
10 test('the resumed call and the store hold each tool result once', async ({
11 request,
12 }) => {
13 const response = await request.post('/api/client-tool-resume-store')
14 expect(response.ok()).toBe(true)
15 const result = (await response.json()) as {
16 ok: boolean
17 error?: string
18 resumedToolResultIds: Array<string>
19 storedToolResultIds: Array<string>
20 }
21 if (!result.ok) throw new Error(`Route failed: ${result.error}`)
22
23 expect(result.resumedToolResultIds).toEqual(['toolu_lookup', 'toolu_ask'])
24 expect(result.storedToolResultIds).toEqual(['toolu_lookup', 'toolu_ask'])
25 })
26})