continuedev/continue · error · Error
no url found
Error message
no url found
What it means
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.
Source
Thrown at core/context/mcp/MCPOauth.ts:37
interface MCPOauthContext {
serverId: string;
ide: IDE;
state?: string;
}
const authenticatingContexts = new Map<string, MCPOauthContext>();
// Map state parameters to server URLs for OAuth callback matching
const stateToServerUrl = new Map<string, string>();
const PORT = 3000;
let serverInstance: http.Server | null = null;
const createServerForOAuth = () =>
http.createServer((req, res) => {
try {
if (!req.url) {
throw new Error("no url found");
}
const parsedUrl = url.parse(req.url, true);
if (!parsedUrl.query["code"]) {
throw new Error("no query params found");
}
const code = parsedUrl.query["code"] as string;
const state = parsedUrl.query["state"] as string | undefined;
void handleMCPOauthCode(code, state);
const html = `
<!DOCTYPE html>
<html>
<head><title>Authentication Complete</title></head>
<body>Authentication Complete. You can close this page now.</body>
</html>`;View on GitHub (pinned to 5522c6f44c)
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
Example fix
// before
new VertexAIApi({ keyJson: SA }); // then gemini stream hits missing genAI
// after
new VertexAIApi({ apiKey: process.env.GEMINI_API_KEY }); // express mode initializes genAI Defensive patterns
Strategy: validation
Validate before calling
if (provider === 'vertexai' && /gemini/i.test(body.model) && !apiConfig.apiKey) throw new Error('gemini GenAI path requires apiKey config'); Try / catch
try { ... } catch (e) { if ((e as Error).message.includes('GoogleGenAI not initialized')) { /* reconstruct adapter with apiKey */ } throw e; } Prevention
- Construct adapters with complete immutable configs
- Don't mutate config after construction
When it happens
Trigger: 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.
Common situations: Constructing the adapter without apiKey then calling gemini streaming that expects the GenAI SDK path; partial config objects; config mutation after construction.
Related errors
- MCP config with URL and no type specified failed both SSE an
- URL is not defined in params
- Response body is null
- Profile ${profileId} not found
- No workspace directories found. Make sure you've opened a fo
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/7f4f96dbb00fc4c5.
Report an issue: GitHub.