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:
+1
@@ -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 })
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user