zen: new inference

This commit is contained in:
Frank
2026-07-02 21:28:38 -04:00
parent 3adfb970bf
commit cb54824f2f
@@ -210,7 +210,10 @@ export async function handler(
) )
logger.debug("REQUEST URL: " + reqUrl) logger.debug("REQUEST URL: " + reqUrl)
logger.debug("REQUEST: " + reqBody.substring(0, 300) + "...") logger.debug("REQUEST: " + reqBody.substring(0, 300) + "...")
const res = await fetchWith429Retry(reqUrl, { const isNewInference = providerInfo.id.startsWith("console.") || providerInfo.id.startsWith("console-go.")
const res = await fetchWith429Retry(
reqUrl,
{
method: "POST", method: "POST",
headers: (() => { headers: (() => {
const headers = new Headers(input.request.headers) const headers = new Headers(input.request.headers)
@@ -240,9 +243,11 @@ export async function handler(
// Propagate caller disconnects to the upstream provider request so // Propagate caller disconnects to the upstream provider request so
// abandoned Console requests do not leave orphaned inference work open. // abandoned Console requests do not leave orphaned inference work open.
signal: input.request.signal, signal: input.request.signal,
}) },
{ count: isNewInference ? MAX_429_RETRIES : 0 },
)
if (providerInfo.id.startsWith("console.") || providerInfo.id.startsWith("console-go.")) { if (isNewInference) {
const resEndpointId = res.headers.get("x-opencode-endpoint-id") const resEndpointId = res.headers.get("x-opencode-endpoint-id")
const resEndpointModelId = res.headers.get("x-opencode-upstream-model-id") const resEndpointModelId = res.headers.get("x-opencode-upstream-model-id")
if (resEndpointId && resEndpointModelId) if (resEndpointId && resEndpointModelId)