Fix bug
This commit is contained in:
@@ -328,6 +328,13 @@ export const PROVIDER_MODELS = {
|
||||
{ id: "deepseek/deepseek-chat", name: "DeepSeek Chat" },
|
||||
{ id: "deepseek/deepseek-reasoner", name: "DeepSeek Reasoner" },
|
||||
],
|
||||
oc: [ // OpenCode
|
||||
{ id: "nemotron-3-super-free", name: "Nemotron 3 Super" },
|
||||
{ id: "qwen3.6-plus-free", name: "Qwen 3.6 Plus" },
|
||||
// { id: "big-pickle", name: "Big Pickle", targetFormat: "claude" },
|
||||
{ id: "minimax-m2.5-free", name: "MiniMax M2.5", targetFormat: "claude" },
|
||||
],
|
||||
|
||||
cl: [ // Cline
|
||||
{ id: "anthropic/claude-sonnet-4.6", name: "Claude Sonnet 4.6" },
|
||||
{ id: "anthropic/claude-opus-4.6", name: "Claude Opus 4.6" },
|
||||
@@ -589,6 +596,7 @@ const OAUTH_ALIASES = {
|
||||
"kimi-coding": "kmc",
|
||||
kilocode: "kc",
|
||||
cline: "cl",
|
||||
opencode: "oc",
|
||||
vertex: "vertex",
|
||||
"vertex-partner": "vertex-partner",
|
||||
};
|
||||
|
||||
@@ -332,4 +332,9 @@ export const PROVIDERS = {
|
||||
baseUrl: "https://copilot.tencent.com/v1/chat/completions",
|
||||
format: "openai",
|
||||
},
|
||||
opencode: {
|
||||
baseUrl: "https://opencode.ai",
|
||||
format: "openai",
|
||||
headers: { "x-opencode-client": "desktop" }
|
||||
},
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ import { CodexExecutor } from "./codex.js";
|
||||
import { CursorExecutor } from "./cursor.js";
|
||||
import { VertexExecutor } from "./vertex.js";
|
||||
import { QwenExecutor } from "./qwen.js";
|
||||
import { OpenCodeExecutor } from "./opencode.js";
|
||||
import { DefaultExecutor } from "./default.js";
|
||||
|
||||
const executors = {
|
||||
@@ -23,6 +24,7 @@ const executors = {
|
||||
vertex: new VertexExecutor("vertex"),
|
||||
"vertex-partner": new VertexExecutor("vertex-partner"),
|
||||
qwen: new QwenExecutor(),
|
||||
opencode: new OpenCodeExecutor(),
|
||||
};
|
||||
|
||||
const defaultCache = new Map();
|
||||
@@ -49,3 +51,4 @@ export { CursorExecutor } from "./cursor.js";
|
||||
export { VertexExecutor } from "./vertex.js";
|
||||
export { DefaultExecutor } from "./default.js";
|
||||
export { QwenExecutor } from "./qwen.js";
|
||||
export { OpenCodeExecutor } from "./opencode.js";
|
||||
|
||||
27
open-sse/executors/opencode.js
Normal file
27
open-sse/executors/opencode.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { BaseExecutor } from "./base.js";
|
||||
import { PROVIDERS } from "../config/providers.js";
|
||||
|
||||
// Models that use /zen/v1/messages (claude format)
|
||||
const MESSAGES_MODELS = new Set(["big-pickle", "minimax-m2.5-free"]);
|
||||
|
||||
export class OpenCodeExecutor extends BaseExecutor {
|
||||
constructor() {
|
||||
super("opencode", PROVIDERS.opencode);
|
||||
}
|
||||
|
||||
buildUrl(model) {
|
||||
const base = "https://opencode.ai";
|
||||
return MESSAGES_MODELS.has(model)
|
||||
? `${base}/zen/v1/messages`
|
||||
: `${base}/zen/v1/chat/completions`;
|
||||
}
|
||||
|
||||
buildHeaders() {
|
||||
return {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer public",
|
||||
"x-opencode-client": "desktop",
|
||||
"Accept": "text/event-stream"
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user