Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(opencode): keep workspace commands retryable after probe timeouts #19636

MergedMarve10s(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/19636/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 101 additions and 8 deletions.

x
0 of 2 viewed, 2 left
88 additions and 0 deletionspackages/provider-opencode/src/server/driver.test.tsModified
View file
@@ -5,6 +5,7 @@
​
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, it } from "@effect/vitest";
+import { createOpencodeClient } from "@opencode-ai/sdk/v2";
import { ProviderInstanceId } from "@t3tools/contracts";
import type { OpenCodeSettings } from "../settings.ts";
import * as HostProcess from "@t3tools/shared/HostProcess";
@@ -22,6 +23,7 @@
import * as ProviderMaintenance from "@t3tools/provider-core/server/maintenanceResolver";
import * as OpenCodeRuntime from "./OpenCodeRuntime.ts";
import {
+ OPENCODE_1_RESPONSES,
OPENCODE_2_RESPONSES,
OPENCODE_2_WORKSPACE_RESPONSES,
replayOpenCodeServer,
@@ -70,6 +72,92 @@
​
const noHttp = HttpClient.make(() => Effect.die("A local binary must not be probed over HTTP"));
​
+const createOpenCode1WorkspaceDriver = (client: ReturnType<typeof createOpencodeClient>) =>
+ create(
+ { serverUrl: "http://127.0.0.1:4096" },
+ replayOpenCodeServer(OPENCODE_1_RESPONSES, ""),
+ ).pipe(
+ Effect.provide(
+ Layer.mock(OpenCodeRuntime.OpenCodeRuntime)({
+ connectToOpenCodeServer: () =>