fix: preserve runtime option defaults (#38118)

This commit is contained in:
Dax 2026-07-21 10:30:18 -04:00 committed by GitHub
commit 7243bd9e12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 5 deletions

View file

@ -0,0 +1,14 @@
import { expect, test } from "bun:test"
import { ServerOptions } from "@opencode-ai/server/options"
import { Option, Schema } from "effect"
const decode = Schema.decodeUnknownOption(ServerOptions)
test("accepts ephemeral port zero", () => {
expect(Option.isSome(decode({ port: 0 }))).toBe(true)
})
test("rejects ports outside the valid range", () => {
expect(Option.isNone(decode({ port: -1 }))).toBe(true)
expect(Option.isNone(decode({ port: 65_536 }))).toBe(true)
})