test: wait for shell truncation readiness (#30679)

This commit is contained in:
Aiden Cline 2026-06-04 00:20:35 -05:00 committed by GitHub
parent 9f42bd4a85
commit 74a27dbf98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1677,7 +1677,7 @@ unix(
yield* llm.tool("bash", {
command:
'i=0; while [ "$i" -lt 4000 ]; do printf "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx %05d\\n" "$i"; i=$((i + 1)); done; sleep 30',
'i=0; while [ "$i" -lt 4000 ]; do printf "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx %05d\\n" "$i"; i=$((i + 1)); done; printf truncation-ready; sleep 30',
description: "Print many lines",
timeout: 30_000,
workdir: path.resolve(dir),
@ -1685,7 +1685,15 @@ unix(
const run = yield* prompt.loop({ sessionID: chat.id }).pipe(Effect.forkChild)
yield* llm.wait(1)
yield* Effect.sleep(150)
yield* pollWithTimeout(
Effect.gen(function* () {
const msgs = yield* MessageV2.filterCompactedEffect(chat.id)
const assistant = msgs.findLast((item) => item.info.role === "assistant")
const tool = assistant ? toolPart(assistant.parts) : undefined
if (tool?.state.status === "running" && tool.state.metadata?.output.includes("truncation-ready")) return true
}),
"timed out waiting for truncated shell output",
)
yield* prompt.cancel(chat.id)
const exit = yield* Fiber.await(run)