Skip to content

Commit 86ba2b2

Browse files
test(opencode): settle the startup status check before the in-place upgrade
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f46ddf2 commit 86ba2b2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/provider-opencode/src/server/driver.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,13 @@ it.layer(layerUpdate)("OpenCodeDriver updates", (it) => {
585585
"opens sessions through OpenCode 2 after the binary is upgraded in place from 1.x",
586586
() =>
587587
Effect.gen(function* () {
588-
serverStarts.length = 0;
589588
versionOutput.current = "1.18.18\n";
590589
const instance = yield* create({}, noHttp);
590+
// Let the startup status check claim the refresh permit, then wait behind it so it
591+
// cannot probe after the upgrade below.
592+
yield* Effect.yieldNow;
593+
yield* instance.snapshot.refresh;
594+
serverStarts.length = 0;
591595
const openSession = instance.orchestrationAdapter
592596
.openSession({
593597
threadId: ThreadId.make("thread-upgraded"),
@@ -603,7 +607,6 @@ it.layer(layerUpdate)("OpenCodeDriver updates", (it) => {
603607
versionOutput.current = "opencode v2.2.4\n";
604608
serverStarts.length = 0;
605609
yield* openSession;
606-
// The initial status check may also start a 2.x server here; only the 1.x adapter connects.
607610
assert.notInclude(
608611
serverStarts,
609612
"connect",

0 commit comments

Comments
 (0)