Repository navigation
feat: add OpenRouter provider - #3337
Conversation
Assisted-By: docker-agent
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
The OpenRouter provider integration is well-structured and consistent with other providers across the codebase. One area to verify before merging: the sandbox env-var handling.
| "ANTHROPIC_API_KEY", | ||
| "GOOGLE_API_KEY", | ||
| "MISTRAL_API_KEY", | ||
| "OPENROUTER_API_KEY", |
There was a problem hiding this comment.
[MEDIUM] OPENROUTER_API_KEY added to proxyManagedEnvVars — verify Docker Desktop proxy support exists
proxyManagedEnvVars is an exclusion list: keys in it are never forwarded to the sandbox container because Docker Desktop's built-in proxy is expected to inject them automatically. Adding OPENROUTER_API_KEY here silently drops the key from the sandbox environment unless Docker Desktop already handles it.
If Desktop proxy support for OpenRouter is not yet live, every sandbox run that uses OpenRouter will fail with 401 Unauthorized with no clear indication of the cause — the key just won't be present inside the container.
All the other entries in the list (OpenAI, Anthropic, Google, Mistral, xAI, Nebius) have confirmed Desktop proxy backing. Before merging, confirm that the same support exists for OPENROUTER_API_KEY, or consider deferring this addition until Desktop proxy coverage is verified.
docker-agent 1.93.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>This release adds OpenRouter as a built-in provider, introduces per-model gateway bypass support, and allows a dedicated model for session compaction, alongside several internal refactoring improvements. ## What's New - Adds OpenRouter as a first-class built-in provider; when `OPENROUTER_API_KEY` is set, the provider is auto-detected and its base URL resolved automatically - Adds a `compaction_model` field to allow a dedicated model for session summary generation, separate from the primary agent model - Adds a `bypass_models_gateway` boolean field on a per-model basis, allowing specific models to connect directly to their provider instead of routing through the configured models gateway ## Technical Changes - Replaces mutex usage with atomic types (`atomic.Bool`, `atomic.Pointer`) for single mutable fields in several structs - Replaces package-level global variables with explicit parameters or struct fields to enable parallel-safe testing across several packages (`toolinstall`, `runtime`, `mcp`, `notification`, `tui`, `cmd/root`) - Adds a concurrency group to the PR review trigger CI workflow to prevent duplicate reviews for the same PR --- ## What's Changed * docs: update CHANGELOG.md for v1.92.0 by @docker-read-write[bot] in docker/docker-agent#3331 * refactor: replace single-variable mutexes with atomic types by @dgageot in docker/docker-agent#3330 * ci: add concurrency group to pr-review-trigger to prevent duplicate reviews by @derekmisler in docker/docker-agent#3334 * refactor: replace test-overridden globals with parallel-safe injection by @dgageot in docker/docker-agent#3332 * feat(compaction): allow a dedicated model for session summary generation by @Sayt-0 in docker/docker-agent#3335 * feat: add OpenRouter provider by @dgageot in docker/docker-agent#3337 * feat: add per-model bypass_models_gateway option by @dgageot in docker/docker-agent#3338 **Full Changelog**: docker/docker-agent@v1.92.0...v1.93.0 </pre> <p>View the full release notes at <a href="https://github.com/docker/docker-agent/releases/tag/v1.93.0">https://github.com/docker/docker-agent/releases/tag/v1.93.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!13152
OpenRouter is an increasingly popular gateway that exposes hundreds of models through a single OpenAI-compatible endpoint, but users had to configure it manually as a custom provider. This change registers it as a first-class built-in alias so the experience is as smooth as Anthropic or Groq.
When
OPENROUTER_API_KEYis set, the provider is auto-detected, its base URL (https://openrouter.ai/api/v1) is resolved automatically, and it surfaces in default/env/sandbox paths the same way every other built-in provider does. The fake proxy gains a URL-rewrite rule so that paths containing/apiare preserved correctly — previously the rewrite stripped the/apisegment, breaking OpenRouter requests in tests. A new example config (examples/openrouter.yaml) and a dedicated docs page round out the addition so users can get started without reading source code.No breaking changes. Existing custom-provider configurations that pointed at
https://openrouter.ai/api/v1continue to work unchanged.