Skip to content
Source
Sign inSign up
pingdotgg/t3code

Refactor OpenCode lifecycle and structured output handling #2218

Mergedjuliusmarmingemerged 9 commits intomain fromrefs/pull/2218/headmerged by juliusmarminge View on GitHub

Showing 14 changed files with 73 additions and 57 deletions (loading 13).

x
0 of 14 viewed, 14 left
73 additions and 57 deletionsapps/server/src/git/Layers/OpenCodeTextGeneration.test.tsModified
View file
@@ -1,18 +1,22 @@
-import type { ChildProcess } from "node:child_process";
-​
import * as NodeServices from "@effect/platform-node/NodeServices";
import { it } from "@effect/vitest";
import { Duration, Effect, Layer } from "effect";
import { TestClock } from "effect/testing";
-import { beforeEach, expect, vi } from "vitest";
+import { NetService } from "@t3tools/shared/Net";
+import { beforeEach, expect } from "vitest";
​
import { ServerConfig } from "../../config.ts";
import { ServerSettingsService } from "../../serverSettings.ts";
+import {
+ OpenCodeRuntime,
+ OpenCodeRuntimeError,
+ type OpenCodeRuntimeShape,
+} from "../../provider/opencodeRuntime.ts";
import { TextGeneration } from "../Services/TextGeneration.ts";
import { OpenCodeTextGenerationLive } from "./OpenCodeTextGeneration.ts";
​
-const runtimeMock = vi.hoisted(() => {
- const state = {
+const runtimeMock = {
+ state: {
startCalls: [] as string[],
promptUrls: [] as string[],
authHeaders: [] as Array<string | null>,
@@ -20,69 +24,77 @@
promptResult: undefined as