plugins: a plugin's fetch gets its body as a string, as OpenCode hands it — the host passed a Buffer, and the plugins that reshape a request (Grok, WorkBuddy, MiMo) touch only a string body, so a moved provider's requests went out as the gateway built them. A UTF-8 body now goes as a string; one that isn't stays bytes. TestFakePlugin fails without the change.

This commit is contained in:
yetone
2026-10-01 03:41:42 +08:00
parent a170b909c9
commit d8f2e17dd7
3 changed files with 19 additions and 1 deletions
+1
View File
@@ -50,6 +50,7 @@ export const FakePlugin = async ({ client }) => ({
const h = new Headers(init.headers)
h.set("authorization", "Bearer " + (a.type === "oauth" ? a.access : a.key))
h.set("x-models", Object.keys(provider.models).sort().join(","))
h.set("x-body-type", typeof init.body)
return fetch(url, { ...init, headers: h })
},
}),