|
|
@@ -20,7 +20,7 @@
|
|
|
import { test, type TestOptions } from "bun:test"
|
|
|
import { FSUtil } from "@opencode-ai/core/fs-util"
|
|
|
import { AppProcess } from "@opencode-ai/core/process"
|
|
|
-import { Deferred, Duration, Effect, Layer, Queue, Scope, Stream } from "effect"
|
|
|
+import { Deferred, Duration, Effect, Layer, Queue, Schedule, Scope, Stream } from "effect"
|
|
|
import { FetchHttpClient, HttpClient } from "effect/unstable/http"
|
|
|
import { ChildProcess } from "effect/unstable/process"
|
|
|
import path from "node:path"
|
|
|
@@ -192,9 +192,13 @@ export function withCliFixture<A, E>(
|
|
|
const fs = yield* FSUtil.Service
|
|
|
const appProc = yield* AppProcess.Service
|
|
|
|
|
|
- // FileSystem.makeTempDirectoryScoped handles both creation and scope-tied
|
|
|
- // cleanup — replaces the old mkdir + addFinalizer pair.
|
|
|
- const home = yield* fs.makeTempDirectoryScoped({ prefix: "oc-cli-" })
|
|
|
+ const home = yield* fs.makeTempDirectory({ prefix: "oc-cli-" })
|
|
|
+ yield* Effect.addFinalizer(() =>
|
|
|
+ fs.remove(home, { recursive: true }).pipe(
|
|
|
+ Effect.retry(Schedule.spaced("50 millis").pipe(Schedule.both(Schedule.recurs(20)))),
|
|
|
+ Effect.ignore,
|
|
|
+ ),
|
|
|
+ )
|
|
|
|
|
|
const configJson = JSON.stringify(testProviderConfig(llm.url))
|
|
|
const env = isolatedEnv(home, configJson)
|