Skip to content

[BOT ISSUE] OpenRouter rerank.rerank() not instrumented #1766

@braintrust-bot

Description

@braintrust-bot

Summary

The OpenRouter TypeScript SDK (@openrouter/sdk) exposes a stable rerank.rerank() method for document reranking by relevance. This repository instruments OpenRouter's chat.send(), embeddings.generate(), beta.responses.send(), and callModel() — but has zero coverage for the rerank API. Users who call rerank.rerank() get no Braintrust spans.

What instrumentation is missing

SDK Method Description
client.rerank.rerank() Reranks documents by relevance to a query using models like cohere/rerank-v3.5

No coverage in any instrumentation layer:

  • No channel definition in js/src/instrumentation/plugins/openrouter-channels.ts — the file defines chatSend, embeddingsGenerate, betaResponsesSend, callModel, callModelTurn, and toolExecute, but nothing for rerank
  • No proxy in js/src/wrappers/openrouter.ts — the wrapper proxies chat, embeddings, beta, and callModel, but not rerank
  • No auto-instrumentation config in js/src/auto-instrumentations/configs/openrouter.ts — configs exist for Chat.send, Embeddings.generate, Responses.send, and OpenRouter.callModel, but not Rerank.rerank
  • No plugin handler in js/src/instrumentation/plugins/openrouter-plugin.ts
  • No e2e test scenario for OpenRouter rerank

A grep for rerank (case-insensitive) across js/src/ returns zero matches.

Context

This repo already instruments the parallel Vercel AI SDK rerank() function (tracked in #1662), confirming that rerank is a recognized instrumentation surface. The OpenRouter SDK's rerank.rerank() is the same class of execution API — model inference that scores and ranks documents — but routed through the OpenRouter SDK rather than the Vercel AI SDK.

Braintrust docs status

not_found — The Braintrust OpenRouter integration docs at https://www.braintrust.dev/docs/integrations/ai-providers/openrouter list chat completions, embeddings, and responses API support but do not mention rerank.

Upstream references

Local files inspected

  • js/src/wrappers/openrouter.ts — no rerank proxy
  • js/src/instrumentation/plugins/openrouter-channels.ts — no rerank channel
  • js/src/instrumentation/plugins/openrouter-plugin.ts — no rerank handler
  • js/src/auto-instrumentations/configs/openrouter.ts — no rerank config
  • js/src/vendor-sdk-types/openrouter.ts — no rerank types
  • e2e/scenarios/ — no OpenRouter rerank test scenario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions