decolua/9router · info
HTTP/2 is required for Cursor AgentService (endpoint is h2-o
Error message
HTTP/2 is required for Cursor AgentService (endpoint is h2-only)
What it means
The Cursor MITM handler is an intentional stub: any Cursor chat request intercepted by the proxy is answered with HTTP 501 and "Cursor MITM support is coming soon." (type "not_implemented"). This is not a fault — the feature is under development and requests are never re-routed for Cursor.
Source
Thrown at open-sse/executors/cursor.js:390
req.on("error", finish(reject));
if (signal) {
const onAbort = finish(() => reject(new Error("Request aborted")));
signal.addEventListener("abort", onAbort, { once: true });
}
req.write(body);
req.end();
});
}
/**
* AgentService (agent.api5.cursor.sh) is HTTP/2-only. Node's fetch/undici speaks
* HTTP/1.1 and fails with HTTPParserError on the h2 preface — use http2 duplex.
*/
openAgentHttp2Stream(url, headers, signal) {
if (!http2) {
throw new Error("HTTP/2 is required for Cursor AgentService (endpoint is h2-only)");
}
const urlObj = new URL(url);
const client = http2.connect(`https://${urlObj.host}`);
const chunkQueue = [];
let waiting = null;
let ended = false;
let streamError = null;
let req = null;
const wake = (result) => {
if (!waiting) return;
const resolve = waiting;
waiting = null;
resolve(result);
};
const fail = (error) => {View on GitHub (pinned to 90b52e06ff)
Solutions
- Remove/disable the 9Router MITM proxy from the Cursor IDE network settings until the feature ships.
- Route Cursor traffic outside the proxy (direct connection) so it is never intercepted.
- Watch the changelog for Cursor MITM support, then update 9Router.
- If re-routing is needed now, use a tool with a real handler (e.g. Kiro, Copilot, Antigravity).
Defensive patterns
Strategy: fallback
Validate before calling
if (tool === 'cursor') {
// Cursor MITM is a 501 stub — do not route Cursor traffic through the proxy
bypassProxyForHost('api.cursor.sh');
} Type guard
function isCursorMitmStub(res) {
return res.status === 501 && res.headers.get('content-type')?.includes('json');
} Try / catch
const res = await send(request);
if (res.status === 501) {
// Cursor MITM not implemented — bypass the proxy for Cursor traffic
} Prevention
- Don't point Cursor IDE at the 9Router MITM proxy until the feature is released.
- Treat any 501 not_implemented from the proxy as 'bypass this host'.
- Check the changelog for Cursor MITM GA before enabling it.
When it happens
Trigger: Cursor IDE sends a request through the MITM proxy, getToolForHost resolves the host to "cursor", and server.js delegates to handlers.cursor.intercept, which unconditionally returns 501.
Common situations: User enabled the 9Router MITM proxy while using the Cursor IDE, expecting model re-routing; every intercepted Cursor request gets 501 regardless of payload.
Related errors
- Machine ID is required for Cursor API
- http2 module not available
- Cursor AgentService endpoint is not configured
- Cursor AgentService request failed: ${error.message}
- ${this.provider} requires accountId in providerSpecificData
AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30).
Data as JSON: /api/errors/0d656740bf5e4add.
Report an issue: GitHub.