mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-05-06 02:07:00 +00:00
fix(sse): use x-api-key for opencode-go minimax messages requests (#733)
OpenCode Go mixes request protocols by model family: - `glm-5` and `kimi-k2.5` use OpenAI-style `/chat/completions` - `minimax-m2.5` and `minimax-m2.7` use Anthropic-style `/messages` OmniRoute already routed MiniMax Go models to `/messages`, but the executor still sent `Authorization: Bearer ...`, which caused upstream `401 Missing API key` errors. This changes `OpencodeExecutor` to send: - `x-api-key` + `anthropic-version` for Claude-targeted OpenCode Go requests - `Authorization: Bearer ...` for the remaining OpenCode Go request formats Also updates unit coverage to assert the correct header behavior for MiniMax Go models. Validated with: - direct curl repro against OpenCode Go endpoints - `node --import tsx/esm --test tests/unit/opencode-executor.test.mjs` - `npm run typecheck:core` - `npm run build`
This commit is contained in:
parent
500bfdf588
commit
b94c0c7d04
2 changed files with 6 additions and 2 deletions
|
|
@ -158,7 +158,7 @@ describe("OpencodeExecutor", () => {
|
|||
);
|
||||
|
||||
assert.deepEqual(result.headers, {
|
||||
Authorization: "Bearer claude-key",
|
||||
"x-api-key": "claude-key",
|
||||
"Content-Type": "application/json",
|
||||
"anthropic-version": "2023-06-01",
|
||||
Accept: "text/event-stream",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue