{"record":{"id":"a51b79b8f37b29d0","repo":"continuedev/continue","slug":"url-is-not-defined-in-params","errorCode":null,"errorMessage":"URL is not defined in params","messagePattern":"URL is not defined in params","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"core/commands/slash/built-in-legacy/http.ts","lineNumber":11,"sourceCode":"import { streamResponse } from \"@continuedev/fetch\";\nimport { SlashCommand } from \"../../../index.js\";\nimport { removeQuotesAndEscapes } from \"../../../util/index.js\";\n\nconst HttpSlashCommand: SlashCommand = {\n  name: \"http\",\n  description: \"Call an HTTP endpoint to serve response\",\n  run: async function* ({ ide, llm, input, params, fetch }) {\n    const url = params?.url;\n    if (!url) {\n      throw new Error(\"URL is not defined in params\");\n    }\n    const response = await fetch(url, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n      },\n      body: JSON.stringify({\n        input: removeQuotesAndEscapes(input),\n      }),\n    });\n\n    // Stream the response\n    if (response.body === null) {\n      throw new Error(\"Response body is null\");\n    }\n    for await (const chunk of streamResponse(response)) {\n      yield chunk;\n    }","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/commands/slash/built-in-legacy/http.ts#L1-L29","documentation":"Thrown during VertexAI adapter construction when the parsed keyJson credentials do not produce a google-auth-library JWT client. The library calls auth.fromJSON(parsed) and expects a JWT instance (service-account style key) so it can attach Vertex AI scopes. Any other credential type (e.g. an API-key JSON or user-refresh credentials) fails this check.","triggerScenarios":"Passing config.keyJson that is valid JSON but not a Google service-account key — e.g. a GCP API key file, an unauthorized-client JSON, or a Vertex AI express-mode API key — so fromJSON returns a non-JWT AuthClient. Also triggered when private_key field is malformed after newline unescaping.","commonSituations":"Developer downloads the wrong key type from Google Cloud console (API key instead of service account JSON), copies a truncated key so \\n escapes become literal newlines mid-key, or pastes a Firebase config object. Typical when migrating from OpenAI-style API keys to Vertex AI service-account auth.","solutions":["Download a proper service-account JSON key (IAM & Admin > Service Accounts > Keys) with roles/aiplatform.user and pass that as keyJson","Verify the JSON has client_email and private_key fields before constructing the adapter","If you only have an API key, use Vertex AI express mode (config.apiKey) with a gemini model instead of keyJson","Ensure the private_key newlines survive transport (keep \\n escapes; the adapter replaces them itself)"],"exampleFix":"// before\nconst api = new VertexAIApi({ keyJson: JSON.stringify({ key: process.env.GCP_API_KEY }) });\n\n// after\nconst api = new VertexAIApi({ keyJson: fs.readFileSync('sa-key.json', 'utf8') }); // full service-account JSON","handlingStrategy":"validation","validationCode":"function isServiceAccountJson(o: any): boolean {\n  return !!o && typeof o === 'object'\n    && typeof o.client_email === 'string' && o.client_email.endsWith('.iam.gserviceaccount.com')\n    && typeof o.private_key === 'string' && o.private_key.includes('-----BEGIN PRIVATE KEY-----');\n}\nconst parsed = JSON.parse(keyJson);\nif (!isServiceAccountJson(parsed)) throw new Error('keyJson is not a service-account key');","typeGuard":"const isServiceAccount = (o: unknown): o is { client_email: string; private_key: string } =>\n  typeof o === 'object' && o !== null &&\n  typeof (o as any).client_email === 'string' &&\n  typeof (o as any).private_key === 'string';","tryCatchPattern":"try { new VertexAIApi({ keyJson }); } catch (e) { if ((e as Error).message.includes('valid JWT')) throw new Error('Provide a service-account JSON key, not an API key'); throw e; }","preventionTips":["Validate key shape before constructing the adapter","Keep service-account keys as files or opaque secrets; never hand-edit them","Use express apiKey mode only with gemini models"],"tags":["vertexai","authentication","service-account","google-auth"],"backgroundTag":"invalid-service-account-credentials","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}