feat(agents): support AI gateway and OpenAI-compatible base-URL overrides (#253) - #279
Open
Clowraider wants to merge 1 commit into
Open
feat(agents): support AI gateway and OpenAI-compatible base-URL overrides (#253)#279Clowraider wants to merge 1 commit into
Clowraider wants to merge 1 commit into
Conversation
…ides (cabinetai#253) - Add customConfigs to ProviderSettings for base-URL and API key overrides - Inject OPENAI_BASE_URL/OPENAI_API_KEY and ANTHROPIC_* into CLI runtime env - Add dynamic HTTP model discovery against /v1/models in providers API - Add GatewayCustomConfig UI section in Settings -> Providers and setup dialog - Fix daemon URL normalization for HTTP health checks when public WS is set
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Option A for #253, enabling users to point Cabinet's agent CLIs at AI gateways (OpenRouter, LiteLLM) or self-hosted OpenAI-compatible endpoints (vLLM, llama.cpp, custom proxies) directly from Settings.
What changed:
Configuration & Persistence:
ProviderSettingswithcustomConfigs?: Record<string, CustomProviderConfig>(baseURL,apiKeyEnvVar) inprovider-settings.tsandprovider-management.ts..cabinet.env.Runtime Environment Injection:
withAdapterRuntimeEnv,provider-runtime.ts, andserver/pty/manager.ts, automatically injectOPENAI_BASE_URL&OPENAI_API_KEY(orANTHROPIC_*for Claude) from provider settings and.cabinet.envinto spawned CLI processes.Dynamic HTTP Model Discovery:
GET /api/agents/providers/[id]/modelsnow queries${baseURL}/modelsvia HTTP when a custombaseURLis set, returning live gateway models to the composer and model combobox with 60s caching and?refresh=1support.Settings UI:
GatewayCustomConfigin Settings -> Providers and in the provider setup dialog, with live model discovery, "Test & Discover Models", and a default model selector.Fixes & Hardening:
getDaemonUrl()to normalizews:///wss://schemes tohttp:///https://during internal HTTP daemon health checks.Verification:
npm testpassing 100% (411/411 unit tests).