test(opencode): synchronize shell cancellation (#33386)

This commit is contained in:
Kit Langton 2026-06-22 17:55:04 +02:00 committed by GitHub
parent 9bceb8eb7d
commit f50e4accf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1711,11 +1711,17 @@ unixNoLLMServer(
withSh(() =>
Effect.gen(function* () {
const { prompt, run, chat } = yield* boot()
const { directory: dir } = yield* TestInstance
const afs = yield* FSUtil.Service
const ready = path.join(dir, ".shell-ready")
const sh = yield* prompt
.shell({ sessionID: chat.id, agent: "build", command: "sleep 30" })
.shell({ sessionID: chat.id, agent: "build", command: ": > '.shell-ready'; sleep 30" })
.pipe(Effect.forkChild)
yield* waitForBusy(chat.id)
yield* pollWithTimeout(
afs.existsSafe(ready).pipe(Effect.map((exists) => (exists ? (true as const) : undefined))),
"shell never created readiness marker",
)
yield* prompt.cancel(chat.id)