refactor: centralize client identity (#38148)

This commit is contained in:
Dax 2026-07-21 14:01:04 -04:00 committed by GitHub
commit 9c38358197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 102 additions and 94 deletions

View file

@ -9,9 +9,11 @@ export const create = Effect.fn("OpenCode.create")(function* (options: ServerOpt
const runtime = yield* Effect.acquireRelease(
Effect.sync(() =>
ManagedRuntime.make(
createEmbeddedRoutes({ ...options, database: { path: ":memory:", ...options.database } }).pipe(
Layer.provide(HttpServer.layerServices),
),
createEmbeddedRoutes({
...options,
client: options.client ?? "sdk",
database: { path: ":memory:", ...options.database },
}).pipe(Layer.provide(HttpServer.layerServices)),
),
),
(runtime) => runtime.disposeEffect,