From 2aa6e501c84f7e150a60ff1e34be23b9808b7113 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Sat, 9 May 2026 15:19:04 -0400 Subject: [PATCH] fix(server): restore /config toJsonSafe projection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the redundant-cleanup hypothesis. The reproducer was upgraded to exercise the actual gemini-auth bug shape — function and bigint values under provider.options (a Schema.Any-typed declared field, not an excess property) — and that fails /config encode without the projection. Effect's onExcessProperty handles excess keys for free, but Schema.Any pass-through plus encode validation doesn't, so the toJsonSafe clone at the HTTP boundary is load-bearing for this case. --- .../src/server/routes/instance/httpapi/handlers/config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/server/routes/instance/httpapi/handlers/config.ts b/packages/opencode/src/server/routes/instance/httpapi/handlers/config.ts index 7d8cc09edd..0abfb604c4 100644 --- a/packages/opencode/src/server/routes/instance/httpapi/handlers/config.ts +++ b/packages/opencode/src/server/routes/instance/httpapi/handlers/config.ts @@ -13,9 +13,10 @@ export const configHandlers = HttpApiBuilder.group(InstanceHttpApi, "config", (h const configSvc = yield* Config.Service const get = Effect.fn("ConfigHttpApi.get")(function* () { - // Plugin `config` hooks may attach non-JSON-safe values (function, - // symbol, undefined, bigint) to the live config. Project a JSON-safe - // copy at the HTTP boundary so the response matches the typed schema + // Plugin `config` hooks may attach runtime-only values (functions, + // bigints, etc.) under schema-allowed fields like provider.options + // (Schema.Any). Project a JSON-safe copy at the HTTP boundary so + // response encode succeeds and clients see the typed schema shape // (mirrors Provider.toPublicInfo in #26550). return toJsonSafe(yield* configSvc.get()) })