{"record":{"id":"0d656740bf5e4add","repo":"decolua/9router","slug":"http-2-is-required-for-cursor-agentservice-endpoi","errorCode":null,"errorMessage":"HTTP/2 is required for Cursor AgentService (endpoint is h2-only)","messagePattern":"HTTP/2 is required for Cursor AgentService \\(endpoint is h2-only\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"open-sse/executors/cursor.js","lineNumber":390,"sourceCode":"      req.on(\"error\", finish(reject));\n\n      if (signal) {\n        const onAbort = finish(() => reject(new Error(\"Request aborted\")));\n        signal.addEventListener(\"abort\", onAbort, { once: true });\n      }\n\n      req.write(body);\n      req.end();\n    });\n  }\n\n  /**\n   * AgentService (agent.api5.cursor.sh) is HTTP/2-only. Node's fetch/undici speaks\n   * HTTP/1.1 and fails with HTTPParserError on the h2 preface — use http2 duplex.\n   */\n  openAgentHttp2Stream(url, headers, signal) {\n    if (!http2) {\n      throw new Error(\"HTTP/2 is required for Cursor AgentService (endpoint is h2-only)\");\n    }\n\n    const urlObj = new URL(url);\n    const client = http2.connect(`https://${urlObj.host}`);\n    const chunkQueue = [];\n    let waiting = null;\n    let ended = false;\n    let streamError = null;\n    let req = null;\n\n    const wake = (result) => {\n      if (!waiting) return;\n      const resolve = waiting;\n      waiting = null;\n      resolve(result);\n    };\n\n    const fail = (error) => {","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/decolua/9router/blob/90b52e06ffd666b7929554211474d01588f6b1f8/open-sse/executors/cursor.js#L372-L408","documentation":"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.","triggerScenarios":"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.","commonSituations":"User enabled the 9Router MITM proxy while using the Cursor IDE, expecting model re-routing; every intercepted Cursor request gets 501 regardless of payload.","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)."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (tool === 'cursor') {\n  // Cursor MITM is a 501 stub — do not route Cursor traffic through the proxy\n  bypassProxyForHost('api.cursor.sh');\n}","typeGuard":"function isCursorMitmStub(res) {\n  return res.status === 501 && res.headers.get('content-type')?.includes('json');\n}","tryCatchPattern":"const res = await send(request);\nif (res.status === 501) {\n  // Cursor MITM not implemented — bypass the proxy for Cursor traffic\n}","preventionTips":["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."],"tags":["mitm","cursor","not-implemented","stub"],"backgroundTag":"feature-not-implemented","analyzedSha":"90b52e06ffd666b7929554211474d01588f6b1f8","analyzedAt":"2026-08-30T21:05:45.952Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}