remove opencode_ prefixes from tool names. unfortunately this will break

all old sessions and share links. we'll be more backwards compatible in
the future once we're more stable.
This commit is contained in:
Dax Raad
2025-06-19 09:59:12 -04:00
parent 568c04753e
commit 26bab00dab
18 changed files with 59 additions and 59 deletions

View File

@@ -274,7 +274,7 @@ export namespace Provider {
const cfg = await Config.get()
const provider = await list()
.then((val) => Object.values(val))
.then((x) => x.find((p) => !cfg.provider || cfg.provider === p.info.id))
.then((x) => x.find((p) => !cfg.provider || Object.keys(cfg.provider).includes(p.info.id)))
if (!provider) throw new Error("no providers found")
const [model] = sort(Object.values(provider.info.models))
if (!model) throw new Error("no models found")
@@ -304,7 +304,7 @@ export namespace Provider {
]
const TOOL_MAPPING: Record<string, Tool.Info[]> = {
anthropic: TOOLS.filter((t) => t.id !== "opencode.patch"),
anthropic: TOOLS.filter((t) => t.id !== "patch"),
openai: TOOLS.map((t) => ({
...t,
parameters: optionalToNullable(t.parameters),