mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 23:24:00 +03:00
feat(console): proxy remaining free Zen models and keep proxied 404 errors (#53963)
This commit is contained in:
committed by
GitHub
Unverified
parent
fa0073c2f3
commit
9c1fdf8f7c
@@ -92,7 +92,10 @@ export async function proxyInference(
|
||||
const requestID = request.headers.get("x-opencode-request-id") ?? request.headers.get("x-opencode-request")
|
||||
if (requestID) forwarded.headers.set("x-opencode-request-id", requestID)
|
||||
|
||||
return fetch(forwarded, { redirect: "manual" })
|
||||
const response = await fetch(forwarded, { redirect: "manual" })
|
||||
// SolidStart replaces 404 responses with its own route-not-found body, hiding the inference error.
|
||||
if (response.status !== 404) return response
|
||||
return new Response(response.body, { status: 400, statusText: "Bad Request", headers: response.headers })
|
||||
}
|
||||
|
||||
// Routing only; the destination owns authentication and revocation after cutover.
|
||||
|
||||
@@ -59,6 +59,7 @@ type BillingSource = "anonymous" | "free" | "byok" | "subscription" | "lite" | "
|
||||
|
||||
// Free models whose keyless requests skip legacy checks and go straight to new inference.
|
||||
const ANONYMOUS_PROXY_MODELS = new Set([
|
||||
"big-pickle",
|
||||
"fledge-alpha-free",
|
||||
"jev-1.13-free",
|
||||
"ling-3.0-flash-fin-free",
|
||||
@@ -66,8 +67,10 @@ const ANONYMOUS_PROXY_MODELS = new Set([
|
||||
"longcat-2.5-preview-free",
|
||||
"mimo-v2.6-flash-free",
|
||||
"muse-spark-1.2-contributor-free",
|
||||
"muse-spark-1.3-contributor-free",
|
||||
"nemotron-3-ultra-free",
|
||||
"nemotron-3.5-lightning-free",
|
||||
"space-bunny-free",
|
||||
])
|
||||
|
||||
function resolve(text: string, params?: Record<string, string | number>) {
|
||||
|
||||
Reference in New Issue
Block a user