decolua/9router · error
Cursor AgentService endpoint is not configured
Error message
Cursor AgentService endpoint is not configured
What it means
Catch-all in the Kiro MITM handler: after mapping the model and calling the router, any exception (fetch failure, EventStream decode error, pipeTransformedEventStream failure) is returned as HTTP 500 JSON with type "mitm_error" and handler:"kiro". The log line `[Kiro MITM] Request processing failed: ...` carries the underlying cause.
Source
Thrown at open-sse/executors/cursor.js:484
try { if (req && !req.destroyed) req.end(); } catch {}
},
close,
async read() {
if (chunkQueue.length) return { value: chunkQueue.shift(), done: false };
if (ended) {
if (streamError) throw streamError;
return { value: undefined, done: true };
}
const result = await new Promise((resolve) => { waiting = resolve; });
if (streamError) throw streamError;
return result || { value: undefined, done: true };
},
};
}
async executeAgent({ model, body, stream, credentials, signal }) {
const agentEndpoint = PROVIDER_OAUTH.cursor?.agentEndpoint;
if (!agentEndpoint) throw new Error("Cursor AgentService endpoint is not configured");
const url = `${agentEndpoint}${AGENT_RUN_PATH}`;
const headers = this.buildHeaders(credentials);
const requestController = new AbortController();
if (signal?.addEventListener) {
signal.addEventListener("abort", () => requestController.abort(signal.reason), { once: true });
}
let session;
try {
session = this.openAgentHttp2Stream(url, headers, requestController.signal);
session.write(buildAgentRunFrame(body.messages || [], model));
} catch (error) {
throw new Error(`Cursor AgentService request failed: ${error.message}`);
}
let responseHeaders;
try {View on GitHub (pinned to 90b52e06ff)
Solutions
- Read `[Kiro MITM] Request processing failed: <msg>` in server logs to identify the real error.
- Confirm the 9Router gateway is running and the MITM proxy forwards to the right LOCAL_PORT.
- Check Kiro connection credentials/refresh state on the router (expired OAuth is a common cause).
- Inspect the payload for content the OpenAI→Kiro translator can't convert (unusual tool blocks/images) and simplify it.
- Retry after fixing; transient failures clear on their own.
Defensive patterns
Strategy: try-catch
Validate before calling
const gatewayUp = await fetch(`http://localhost:${LOCAL_PORT}/dashboard`).then(r => r.ok).catch(() => false);
const kiroAuth = connection.authType === 'oauth' && connection.refreshToken ? 'ok' : 'check-credentials';
if (!gatewayUp || kiroAuth !== 'ok') throw new Error('Fix gateway/credentials before Kiro MITM routing'); Try / catch
try {
await sendViaKiroMitm(body);
} catch (e) {
const msg = String(e.message);
if (/unauthorized|expired|authentication/i.test(msg)) reauthorizeKiroConnection();
else if (/ECONNREFUSED|fetch failed/.test(msg)) ensureGatewayRunning();
} Prevention
- Keep the Kiro connection's OAuth tokens fresh in the dashboard.
- Confirm gateway availability before routing Kiro traffic through the MITM.
- Avoid payloads with content shapes the OpenAI→Kiro translator may not support (exotic tool blocks).
- Grep `[Kiro MITM] Request processing failed` logs to catch systemic issues early.
When it happens
Trigger: Kiro IDE sends a chat request intercepted by the MITM proxy (path /generateAssistantResponse or x-amz-target on `/`), a model mapping exists, and the intercept flow throws — router unreachable, OpenAI→Kiro conversion error, or upstream EventStream error.
Common situations: Router down or on the wrong port; request body fails convertOpenAIToKiro translation (unsupported content shape); upstream Kiro service rejects credentials; network interruption while piping the transformed EventStream.
Related errors
- Binary EventStream format detected (${bodyBuffer.length}B) -
- [Kiro MITM] Request processing failed: ${error.message}
- http2 module not available
- Kiro toolUseEvent is empty
- Kiro toolUseEvent is missing a tool name
AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30).
Data as JSON: /api/errors/dc05f7f4a2b20c19.
Report an issue: GitHub.