feat(openrouter): send HTTP-Referer and X-Title headers in core/llm OpenRouter class

Merged
RO
7mo ago
+19-2

Summary

  • Adds HTTP-Referer, X-OpenRouter-Title, and X-OpenRouter-Categories headers to the core/llm OpenRouter class, matching what #11857 did for the openai-adapters OpenRouter class
  • Uses X-OpenRouter-Title (the newer official header) instead of X-Title
  • Adds X-OpenRouter-Categories: ide-extension for marketplace attribution
  • Deduplicates headers by exporting OPENROUTER_HEADERS from openai-adapters and importing it in core
  • User-configured requestOptions.headers take precedence over the defaults

Builds on #11857

Test plan

  • Verify OpenRouter requests from the core/llm path include HTTP-Referer, X-OpenRouter-Title, and X-OpenRouter-Categories headers
  • Verify user-configured requestOptions.headers can still override these defaults
  • Confirm the OpenRouter activity dashboard shows "Continue" in the App column