Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(opencode): sessions open through OpenCode 2 after an in-place upgrade from 1.x #27779

Mergedjuliusmarmingemerged 6 commits intomain fromrefs/pull/27779/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 49 additions and 5 deletions.

x
0 of 3 viewed, 3 left
41 additions and 1 deletionpackages/provider-opencode/src/server/driver.test.tsModified
View file
@@ -6,7 +6,12 @@
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, it } from "@effect/vitest";
-import { DEFAULT_SERVER_SETTINGS, ProviderInstanceId } from "@t3tools/contracts";
+import {
+ DEFAULT_SERVER_SETTINGS,
+ ProviderInstanceId,
+ ProviderSessionId,
+ ThreadId,
+} from "@t3tools/contracts";
import type { OpenCodeSettings } from "../settings.ts";
import * as HostProcess from "@t3tools/shared/HostProcess";
import * as Deferred from "effect/Deferred";
@@ -575,4 +580,39 @@
assert.isNull(v2.update);
}).pipe(Effect.scoped),
+​
+ it.effect(
+ "opens sessions through OpenCode 2 after the binary is upgraded in place from 1.x",
+ () =>
+ Effect.gen(function* () {
+ versionOutput.current = "1.18.18\n";
+ const instance = yield* create({}, noHttp);
+ // Let the startup status check claim the refresh permit, then wait behind it so it
+ // cannot probe after the upgrade below.
+ yield* Effect.yieldNow;
+ yield* instance.snapshot.refresh;