{"record":{"id":"7f4f96dbb00fc4c5","repo":"continuedev/continue","slug":"no-url-found","errorCode":null,"errorMessage":"no url found","messagePattern":"no url found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/mcp/MCPOauth.ts","lineNumber":37,"sourceCode":"interface MCPOauthContext {\n  serverId: string;\n  ide: IDE;\n  state?: string;\n}\nconst authenticatingContexts = new Map<string, MCPOauthContext>();\n\n// Map state parameters to server URLs for OAuth callback matching\nconst stateToServerUrl = new Map<string, string>();\n\nconst PORT = 3000;\n\nlet serverInstance: http.Server | null = null;\n\nconst createServerForOAuth = () =>\n  http.createServer((req, res) => {\n    try {\n      if (!req.url) {\n        throw new Error(\"no url found\");\n      }\n\n      const parsedUrl = url.parse(req.url, true);\n      if (!parsedUrl.query[\"code\"]) {\n        throw new Error(\"no query params found\");\n      }\n\n      const code = parsedUrl.query[\"code\"] as string;\n      const state = parsedUrl.query[\"state\"] as string | undefined;\n\n      void handleMCPOauthCode(code, state);\n\n      const html = `\n<!DOCTYPE html>\n<html>\n<head><title>Authentication Complete</title></head>\n<body>Authentication Complete. You can close this page now.</body>\n</html>`;","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/mcp/MCPOauth.ts#L19-L55","documentation":"The gemini streaming branch requires this.genAI (a GoogleGenAI instance), which is only constructed when apiKey/express mode is configured. Reaching this case with genAI unset means the adapter state is inconsistent with the routing decision.","triggerScenarios":"Internal state mismatch: determineVertexProvider returned 'gemini' but config.apiKey was absent so the GoogleGenAI client was never initialized — typically from a misconfigured or programmatically mutated config object.","commonSituations":"Constructing the adapter without apiKey then calling gemini streaming that expects the GenAI SDK path; partial config objects; config mutation after construction.","solutions":["Provide apiKey for gemini streaming via the GenAI path, or ensure the OAuth path routes gemini correctly","Construct a fresh adapter with a complete, immutable config rather than mutating one","Update the adapter — init/routing coupling may be fixed in newer versions"],"exampleFix":"// before\nnew VertexAIApi({ keyJson: SA }); // then gemini stream hits missing genAI\n\n// after\nnew VertexAIApi({ apiKey: process.env.GEMINI_API_KEY }); // express mode initializes genAI","handlingStrategy":"validation","validationCode":"if (provider === 'vertexai' && /gemini/i.test(body.model) && !apiConfig.apiKey) throw new Error('gemini GenAI path requires apiKey config');","typeGuard":null,"tryCatchPattern":"try { ... } catch (e) { if ((e as Error).message.includes('GoogleGenAI not initialized')) { /* reconstruct adapter with apiKey */ } throw e; }","preventionTips":["Construct adapters with complete immutable configs","Don't mutate config after construction"],"tags":["vertexai","gemini","initialization","internal"],"backgroundTag":"client-not-initialized","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}