Drop Config Info Zod static (#26933)

This commit is contained in:
Kit Langton 2026-05-11 16:49:22 -04:00 committed by GitHub
commit fe7ca3421e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 25 deletions

View file

@ -251,7 +251,7 @@ test("updates global config and omits empty shell key in jsonc", async () => {
const file = path.join(tmp.path, "opencode.jsonc")
const writtenConfig = await Filesystem.readText(file)
const parsed = ConfigParse.schema(Config.Info.zod, ConfigParse.jsonc(writtenConfig, file), file)
const parsed = ConfigParse.effectSchema(Config.Info, ConfigParse.jsonc(writtenConfig, file), file)
expect(writtenConfig).not.toContain('"shell"')
expect(parsed.shell).toBeUndefined()
expect(parsed.model).toBe("test/model")

View file

@ -1,6 +1,6 @@
import { afterEach, describe, expect, mock, test } from "bun:test"
import { APICallError } from "ai"
import { Cause, Deferred, Effect, Exit, Fiber, Layer } from "effect"
import { Cause, Deferred, Effect, Exit, Fiber, Layer, Schema } from "effect"
import * as Stream from "effect/Stream"
import { Bus } from "../../src/bus"
import { Config } from "@/config/config"
@ -211,7 +211,7 @@ function layer(result: "continue" | "compact") {
}
function cfg(compaction?: Config.Info["compaction"]) {
const base = Config.Info.zod.parse({})
const base = Schema.decodeUnknownSync(Config.Info)({}) as Config.Info
return TestConfig.layer({
get: () => Effect.succeed({ ...base, compaction }),
})