chore: generate
This commit is contained in:
@@ -64,9 +64,7 @@ async function patchWithMock(
|
|||||||
// Wait for the agent loop to actually start before checking idle.
|
// Wait for the agent loop to actually start before checking idle.
|
||||||
// promptAsync is fire-and-forget — without this, waitSessionIdle can
|
// promptAsync is fire-and-forget — without this, waitSessionIdle can
|
||||||
// return immediately because the session status is still undefined.
|
// return immediately because the session status is still undefined.
|
||||||
await expect
|
await expect.poll(() => llm.calls().then((c) => c > callsBefore), { timeout: 30_000 }).toBe(true)
|
||||||
.poll(() => llm.calls().then((c) => c > callsBefore), { timeout: 30_000 })
|
|
||||||
.toBe(true)
|
|
||||||
|
|
||||||
await waitSessionIdle(sdk, sessionID, 120_000)
|
await waitSessionIdle(sdk, sessionID, 120_000)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,15 +183,11 @@ it.live("tool execution produces non-empty session diff (snapshot race)", () =>
|
|||||||
|
|
||||||
// Use bash tool (always registered) to create a file
|
// Use bash tool (always registered) to create a file
|
||||||
const command = `echo 'snapshot race test content' > ${path.join(dir, "race-test.txt")}`
|
const command = `echo 'snapshot race test content' > ${path.join(dir, "race-test.txt")}`
|
||||||
yield* llm.toolMatch(
|
yield* llm.toolMatch((hit) => JSON.stringify(hit.body).includes("create the file"), "bash", {
|
||||||
(hit) => JSON.stringify(hit.body).includes("create the file"),
|
command,
|
||||||
"bash",
|
description: "create test file",
|
||||||
{ command, description: "create test file" },
|
})
|
||||||
)
|
yield* llm.textMatch((hit) => JSON.stringify(hit.body).includes("bash"), "done")
|
||||||
yield* llm.textMatch(
|
|
||||||
(hit) => JSON.stringify(hit.body).includes("bash"),
|
|
||||||
"done",
|
|
||||||
)
|
|
||||||
|
|
||||||
// Seed user message
|
// Seed user message
|
||||||
yield* prompt.prompt({
|
yield* prompt.prompt({
|
||||||
@@ -208,7 +204,10 @@ it.live("tool execution produces non-empty session diff (snapshot race)", () =>
|
|||||||
// Verify the file was created
|
// Verify the file was created
|
||||||
const filePath = path.join(dir, "race-test.txt")
|
const filePath = path.join(dir, "race-test.txt")
|
||||||
const fileExists = yield* Effect.promise(() =>
|
const fileExists = yield* Effect.promise(() =>
|
||||||
fs.access(filePath).then(() => true).catch(() => false),
|
fs
|
||||||
|
.access(filePath)
|
||||||
|
.then(() => true)
|
||||||
|
.catch(() => false),
|
||||||
)
|
)
|
||||||
expect(fileExists).toBe(true)
|
expect(fileExists).toBe(true)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user