fix: remove 10 more unnecessary as any casts in opencode core (#22882)

This commit is contained in:
Kit Langton
2026-04-16 16:11:05 -04:00
committed by GitHub
parent 5e650fd9e2
commit 1c33b866ba
6 changed files with 30 additions and 36 deletions

View File

@@ -12,7 +12,6 @@ import { Config } from "../../config"
import { ConsoleState } from "../../config/console-state"
import { Account, AccountID, OrgID } from "../../account"
import { AppRuntime } from "../../effect/app-runtime"
import { zodToJsonSchema } from "zod-to-json-schema"
import { errors } from "../error"
import { lazy } from "../../util/lazy"
import { Effect, Option } from "effect"
@@ -226,8 +225,7 @@ export const ExperimentalRoutes = lazy(() =>
tools.map((t) => ({
id: t.id,
description: t.description,
// Handle both Zod schemas and plain JSON schemas
parameters: (t.parameters as any)?._def ? zodToJsonSchema(t.parameters as any) : t.parameters,
parameters: z.toJSONSchema(t.parameters),
})),
)
},