refactor(open-sse): source mimo-free/opencode base URL from PROVIDERS

CHAT_URL and opencode buildUrl base now read from PROVIDERS instead of repeating
the literal. Values identical; providers byte-for-byte + gate clean.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
decoluaandCursor committed 2026-06-13 20:40:43 +07:00
1 parent 64182c0484
commit bb597cbced
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ import { createHash } from "crypto";
import os from "os"; import os from "os";
const BOOTSTRAP_URL = "https://api.xiaomimimo.com/api/free-ai/bootstrap"; const BOOTSTRAP_URL = "https://api.xiaomimimo.com/api/free-ai/bootstrap";
const CHAT_URL = "https://api.xiaomimimo.com/api/free-ai/openai/chat"; const CHAT_URL = PROVIDERS["mimo-free"].baseUrl;
const SESSION_AFFINITY_PREFIX = "ses_"; const SESSION_AFFINITY_PREFIX = "ses_";
const SESSION_ID_LENGTH = 24; const SESSION_ID_LENGTH = 24;
const JWT_FALLBACK_TTL_SEC = 3000; const JWT_FALLBACK_TTL_SEC = 3000;
+1 -1
View File
@@ -15,7 +15,7 @@ export class OpenCodeExecutor extends BaseExecutor {
} }
buildUrl(model) { buildUrl(model) {
const base = "https://opencode.ai"; const base = this.config.baseUrl;
return MESSAGES_MODELS.has(model) return MESSAGES_MODELS.has(model)
? `${base}/zen/v1/messages` ? `${base}/zen/v1/messages`
: `${base}/zen/v1/chat/completions`; : `${base}/zen/v1/chat/completions`;
+1 -1
View File
@@ -1 +1 @@
{"numTotalTestSuites":222,"numPassedTestSuites":205,"numFailedTestSuites":17,"numPendingTestSuites":0,"numTotalTests":827,"numPassedTests":781,"numFailedTests":26,"numPendingTests":20,"numTodoTests":0,"snapshot":{"added":0,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":153,"total":153,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0,"didUpdate":false},"startTime":1781357417485,"success":false,"testResults":[{"aLine truncated {"numTotalTestSuites":222,"numPassedTestSuites":205,"numFailedTestSuites":17,"numPendingTestSuites":0,"numTotalTests":827,"numPassedTests":781,"numFailedTests":26,"numPendingTests":20,"numTodoTests":0,"snapshot":{"added":0,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":153,"total":153,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0,"didUpdate":false},"startTime":1781357868044,"success":false,"testResults":[{"aLine truncated