Skip to content

Commit 131062b

Browse files
committed
fix: exit probe after disposing instance
1 parent 464f6fa commit 131062b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/opencode/script/verify-copilot-responses.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ async function main() {
200200
process.stdout.write(`Providers: ${args.providerIDs.join(", ")}\n`)
201201
process.stdout.write(`Timeout: ${args.timeoutMs}ms, Delay: ${args.delayMs}ms\n\n`)
202202

203+
let hadFailure = false
203204
await Instance.provide({
204205
directory: process.cwd(),
205206
async fn() {
@@ -241,6 +242,7 @@ async function main() {
241242
process.stdout.write("OK\n")
242243
} else {
243244
failCount++
245+
hadFailure = true
244246
process.stdout.write(`FAIL (${result.error})\n`)
245247
}
246248

@@ -253,6 +255,11 @@ async function main() {
253255
}
254256
},
255257
})
258+
259+
// Important: OpenCode may start background servers/plugins that keep the event loop alive.
260+
// Dispose all instance state and exit explicitly.
261+
await Instance.disposeAll()
262+
process.exit(hadFailure ? 1 : 0)
256263
}
257264

258265
await main()

0 commit comments

Comments
 (0)