continuedev/continue · error · Error

Failed to fetch messages: ${response.statusText}

Error message

Failed to fetch messages: ${response.statusText}

What it means

Non-2xx from the Vertex embeddings (predict) endpoint. The embeddings request is JSON-POSTed with auth headers; failure status/statusText is surfaced without the body.

Source

Thrown at core/context/providers/DiscordContextProvider.ts:64

  get deprecationMessage() {
    return "The Discord context provider is now deprecated and may be removed in a later version. Please consider using the Discord MCP (hub.docker.com/r/mcp/mcp-discord) instead.";
  }

  async fetchMessages(
    channelId: string,
    fetch: FetchFunction,
  ): Promise<Array<DiscordMessage>> {
    const url = this.getUrl(`/channels/${channelId}/messages`);
    // Fetch messages from the specified channel using the provided fetch function
    const response = await fetch(url, {
      headers: {
        Authorization: `Bot ${this.options.discordKey}`,
        "Content-Type": "application/json",
      },
    });

    if (!response.ok) {
      throw new Error(`Failed to fetch messages: ${response.statusText}`);
    }

    return response.json();
  }

  async fetchChannels(fetch: FetchFunction): Promise<Array<DiscordChannel>> {
    const url = this.getUrl(`/guilds/${this.options.guildId}/channels`);
    const response = await fetch(url, {
      headers: {
        Authorization: `Bot ${this.options.discordKey}`,
        "Content-Type": "application/json",
      },
    });

    if (!response.ok) {
      throw new Error(`Failed to fetch channels: ${response.statusText}`);
    }

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Verify the embedding model id and enable it in the project (e.g. text-embedding-004)
  2. Reduce batch size / truncate inputs and retry
  3. Refresh auth (re-run ADC login or use fresh keyJson); test the same request with curl
  4. Add error handling that logs response body by re-issuing the request manually
Defensive patterns

Strategy: retry

Try / catch

try { await api.embed(body); } catch (e) { const m = (e as Error).message; if (m.includes('429')) { body.input = chunk(body.input, Math.ceil(body.input.length / 2)); await retry(); } else throw e; }

Prevention

When it happens

Trigger: Embedding model name invalid for the project (e.g. textembedding model not enabled), auth token expired, wrong project/region, input batch exceeding token limits producing 400.

Common situations: Switching embedding models without enabling them in Vertex; batching too many/large inputs; expired ADC tokens in long-running workers.

Related errors


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