continuedev/continue · warning · Error

LastXCommitsDepth must be a number

Error message

LastXCommitsDepth must be a number

What it means

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.

Source

Thrown at core/context/providers/GitCommitContextProvider.ts:57

class GitCommitContextProvider extends BaseContextProvider {
  static description: ContextProviderDescription = {
    title: "commit",
    displayTitle: "Commits",
    description: "Type to search",
    type: "submenu",
  };

  get deprecationMessage() {
    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.";
  }

  async getContextItems(
    query: string,
    extras: ContextProviderExtras,
  ): Promise<ContextItem[]> {
    const lastXCommitsDepth = this.options?.LastXCommitsDepth ?? 10;
    if (typeof lastXCommitsDepth !== "number") {
      throw new Error("LastXCommitsDepth must be a number");
    }
    const topLevelDir = fileURLToPath((await extras.ide.getWorkspaceDirs())[0]);

    try {
      if (query.includes("last ")) {
        const content = await runGitCommand(
          [
            "--no-pager",
            "log",
            '--pretty=format:"%H,%h,%an,%ae,%ad,%P,%s,%b"',
            "-p",
            "-n",
            lastXCommitsDepth.toString(),
          ],
          topLevelDir,
        );
        return [
          {

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Hardcode/configure the Vertex model ids your app offers
  2. Skip Vertex in list() enumeration (feature-detect via a capability flag or try/catch)
  3. Maintain your own model catalog updated from Google's docs

Example fix

// before
const models = await vertexApi.list();

// after
const models = await safeList(api); // returns [] when list() throws
async function safeList(a){ try { return await a.list(); } catch { return []; } }
Defensive patterns

Strategy: type-guard

Validate before calling

const canListModels = (provider: string): boolean => provider !== 'vertexai';

Type guard

const isListable = (api: { list?: () => Promise<Model[]> }): boolean => typeof api.list === 'function' && !/VertexAI provider does not support/.test(''); // prefer provider flag

Try / catch

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; } }

Prevention

When it happens

Trigger: Any call to list() on the VertexAI adapter — e.g. a UI or CLI enumerating available models across providers.

Common situations: Generic model-picker code iterating providers; migration from OpenAI adapter where list() works.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/0bbcad49f340a345. Report an issue: GitHub.