{"record":{"id":"0bbcad49f340a345","repo":"continuedev/continue","slug":"lastxcommitsdepth-must-be-a-number","errorCode":null,"errorMessage":"LastXCommitsDepth must be a number","messagePattern":"LastXCommitsDepth must be a number","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"core/context/providers/GitCommitContextProvider.ts","lineNumber":57,"sourceCode":"class GitCommitContextProvider extends BaseContextProvider {\n  static description: ContextProviderDescription = {\n    title: \"commit\",\n    displayTitle: \"Commits\",\n    description: \"Type to search\",\n    type: \"submenu\",\n  };\n\n  get deprecationMessage() {\n    return \"The git commits context provider is now deprecated and may be removed in a later version. Please consider using the Git MCP (https://continue.dev/docker/mcp-git) instead.\";\n  }\n\n  async getContextItems(\n    query: string,\n    extras: ContextProviderExtras,\n  ): Promise<ContextItem[]> {\n    const lastXCommitsDepth = this.options?.LastXCommitsDepth ?? 10;\n    if (typeof lastXCommitsDepth !== \"number\") {\n      throw new Error(\"LastXCommitsDepth must be a number\");\n    }\n    const topLevelDir = fileURLToPath((await extras.ide.getWorkspaceDirs())[0]);\n\n    try {\n      if (query.includes(\"last \")) {\n        const content = await runGitCommand(\n          [\n            \"--no-pager\",\n            \"log\",\n            '--pretty=format:\"%H,%h,%an,%ae,%ad,%P,%s,%b\"',\n            \"-p\",\n            \"-n\",\n            lastXCommitsDepth.toString(),\n          ],\n          topLevelDir,\n        );\n        return [\n          {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/GitCommitContextProvider.ts#L39-L75","documentation":"Model listing is not implemented for the Vertex AI adapter; list() always throws. Vertex's model catalog isn't exposed through a simple list API in this adapter, so the capability is explicitly stubbed out.","triggerScenarios":"Any call to list() on the VertexAI adapter — e.g. a UI or CLI enumerating available models across providers.","commonSituations":"Generic model-picker code iterating providers; migration from OpenAI adapter where list() works.","solutions":["Hardcode/configure the Vertex model ids your app offers","Skip Vertex in list() enumeration (feature-detect via a capability flag or try/catch)","Maintain your own model catalog updated from Google's docs"],"exampleFix":"// before\nconst models = await vertexApi.list();\n\n// after\nconst models = await safeList(api); // returns [] when list() throws\nasync function safeList(a){ try { return await a.list(); } catch { return []; } }","handlingStrategy":"type-guard","validationCode":"const canListModels = (provider: string): boolean => provider !== 'vertexai';","typeGuard":"const isListable = (api: { list?: () => Promise<Model[]> }): boolean => typeof api.list === 'function' && !/VertexAI provider does not support/.test(''); // prefer provider flag","tryCatchPattern":"async function safeList(api: any): Promise<Model[]> { try { return await api.list(); } catch (e) { if ((e as Error).message.includes('model listing')) return []; throw e; } }","preventionTips":["Maintain a static model catalog for Vertex","Skip list() for providers without listing support"],"tags":["vertexai","model-listing","not-implemented"],"backgroundTag":"feature-not-implemented","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}