Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): recover OpenCode turns from live busy status #11640

Closedhugojosefson(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/11640/headopened View on GitHub

Showing 2 changed files with 208 additions and 0 deletions.

x
0 of 2 viewed, 2 left
149 additions and 0 deletionsapps/server/src/provider/Layers/OpenCodeAdapter.test.tsModified
View file
@@ -4888,6 +4888,155 @@
+ for (const previousState of ["completed", "failed", "interrupted"] as const) {
+ for (const liveStatus of ["busy", "idle", "unknown"] as const) {
+ it.effect(
+ `checks live status after ${previousState} before ${liveStatus} recovery`,
+ () =>
+ Effect.gen(function* () {
+ const adapter = yield* OpenCodeAdapter;
+ const threadId = asThreadId(`thread-adopt-${previousState}-${liveStatus}`);
+ const sessionID = "http://127.0.0.1:9999/session";
+ const enqueue = makeOpenCodeEventQueue();
+ yield* adapter.startSession({
+ provider: ProviderDriverKind.make("opencode"),
+ threadId,
+ runtimeMode: "full-access",
+ });
+ const turn = yield* adapter.sendTurn({
+ threadId,
+ input: "Read the synthetic fixture",
+ modelSelection: createModelSelection(
+ ProviderInstanceId.make("opencode"),
+ "opencode/kimi-k3",
+ ),
+ });
+ const settled = yield* adapter.streamEvents.pipe(
+ Stream.filter(
+ (event) =>