continuedev/continue · error · Error

Method not implemented.

Error message

Method not implemented.

What it means

MockAdapter.rerank intentionally throws 'Method not implemented.' — the mock adapter implements chat/completion/embed/list but not reranking, so rerank paths fail fast in tests.

Source

Thrown at packages/openai-adapters/src/apis/Mock.ts:144

    return {
      data: [
        {
          embedding: new Array(1536).fill(0),
          index: 0,
          object: "embedding",
        },
      ],
      model: body.model,
      object: "list",
      usage: {
        prompt_tokens: 0,
        total_tokens: 0,
      },
    };
  }

  async rerank(body: RerankCreateParams): Promise<CreateRerankResponse> {
    throw new Error("Method not implemented.");
  }

  async list(): Promise<Model[]> {
    return [
      {
        id: "mock-model",
        created: Date.now(),
        object: "model",
        owned_by: "mock",
      },
    ];
  }
}

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Stub rerank in your test with vi.fn()/jest.fn() returning a fixed CreateRerankResponse
  2. Extend MockAdapter in your test file to implement rerank
  3. Use a real rerank-capable provider behind a network mock (e.g. msw)

Example fix

// before
const api = new MockAdapter(config);
await api.rerank(params); // throws
// after
api.rerank = async () => ({ results: [{ index: 0, relevance_score: 0.9 }], model: 'mock' });
Defensive patterns

Strategy: fallback

Validate before calling

// n/a (test-time stubbing)

Try / catch

try { await mock.rerank(p); } catch (e) { if (e.message === 'Method not implemented.') return fixtureRerankResponse; throw e; }

Prevention

When it happens

Trigger: Calling rerank() on a MockAdapter in unit tests or offline dev environments.

Common situations: Test suites that exercise a rerank feature using the Mock provider; the mock lacks rerank so the test errors instead of returning fixture data.

Related errors


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