feat(agent-langgraph): add orcarouter as a named BOT_PROVIDER - #291
Open
putraperdana1207-pixel wants to merge 1 commit into
Open
feat(agent-langgraph): add orcarouter as a named BOT_PROVIDER#291putraperdana1207-pixel wants to merge 1 commit into
putraperdana1207-pixel wants to merge 1 commit into
Conversation
Add orcarouter as a fourth provider for the framework Bot, wired exactly like the existing openai branch: its own key (ORCAROUTER_API_KEY), a default endpoint (ORCAROUTER_BASE_URL, https://api.orcarouter.ai/v1) and a namespaced default model (orcarouter/fusion). OrcaRouter is an OpenAI-compatible gateway, so the ChatOpenAI integration carries it. Document the new provider in .env.example, docs/configuration.md and the README, forward the variables through docker-compose, and note the new option in the changelog. Co-Authored-By: Claude <noreply@anthropic.com>
putraperdana1207-pixel
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
August 30, 2026 00:15
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.
What this changes
Adds OrcaRouter as a first-class named provider for the LangGraph Bot,
agent-langgraph.OpenBot's framework Bot already lets a deployment choose who answers its model calls via
BOT_PROVIDER, withopenai,anthropicandgoogleas named options. This addsorcaroutertothat list, wired to mirror the existing
openaibranch exactly, because OrcaRouter speaks the sameOpenAI API.
OrcaRouter is an OpenAI-compatible AI gateway built for both models and
agents. Like OpenRouter, it exposes a provider/model namespace across many models — the catalogue
serves namespaced ids such as
orcarouter/fusionandopenai/gpt-5.5behind one endpoint — but italso combines adaptive routing, automatic failover, zero-markup inference, observability,
guardrails, and agent-tool governance behind the same endpoint. Adding
orcarouteras a first-classprovider means this project's users can use that stack directly, without treating OrcaRouter as an
anonymous custom base URL.
It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every
prompt/response and governing every tool call on a default-deny basis, with no application code
changes.
Why this shape
The repo already documents that any OpenAI-shaped endpoint can stand in for OpenAI via
OPENAI_BASE_URL, and the framework Bot reads that forBOT_PROVIDER=openai. OrcaRouter could bereached that way. But the repo treats
openai,anthropicandgoogleas named providers — eachwith its own key variable, base URL and default model — precisely so a deployment never needs a key
for a vendor it does not use.
orcarouteris the first provider that is not a model vendor, and itbelongs in that registry rather than as a
OPENAI_BASE_URLincantation:agent-langgraph/src/index.tsBOT_PROVIDER=orcarouterbranch inbuildModel(),defaultModelFor(),KEY_VARIABLE, plusORCAROUTER_BASE_URLopenaibranch, which also constructs aChatOpenAI.env.exampleORCAROUTER_API_KEY,ORCAROUTER_BASE_URLdocumented next to the other providers' keys and base URLsANTHROPIC_API_KEY/ANTHROPIC_BASE_URL,GOOGLE_API_KEY/GOOGLE_GENERATIVE_AI_BASE_URLdocs/configuration.mdBOT_PROVIDERrow extended;ORCAROUTER_API_KEY/ORCAROUTER_BASE_URLrows; a paragraph in "OpenAI-compatible endpoints"docker-compose.ymlORCAROUTER_API_KEYandORCAROUTER_BASE_URLinto theagent-langgraphcontainerANTHROPIC_*/GOOGLE_*README.mdCHANGELOG.mdUnreleasedentryConfiguration
ORCAROUTER_BASE_URLdefaults tohttps://api.orcarouter.ai/v1and can point at a self-hostedgateway. Model names travel verbatim, exactly as the repo documents for the other providers.
Where it runs
process start, the same way
BOT_PROVIDER=anthropicis. Nothing is held in a module-levelMapor closure.environment before the process serves, so every replica reads the same variables and builds
the same client. No shared state.
OPENBOT_TOOL_URL/AGENT_TOOL_TOKENpath unchanged.agent-langgraphstill listens on its one port.Boundary and audit
does not add a tool path or touch the server gateway, policy, or audit.
Changelog
Unreleased.Proof
bun run format:check,bun run lint,bun run typecheck— clean.agent-langgraphtests — 15 pass.tests/compose.test.ts— 7 pass.agent-langgraph/src/index.tsagainst the pristine file shows no new errors (thepackage is not part of the root
typecheckworkspace, matching CI).agent-langgraphwithBOT_PROVIDER=orcarouter+ORCAROUTER_API_KEY, and ran a full AG-UI turn through/ag-ui./healthreported{"status":"ok","provider":"orcarouter","model":"orcarouter/fusion"},and the turn streamed
RUN_STARTED→TEXT_MESSAGE_*→RUN_FINISHEDwith HTTP 200. Atool-calling turn also streamed
TOOL_CALL_START/ARGS/ENDthrough the same endpoint.Note: the full
bun testsuite needs a PostgreSQL service (CI spins one up); thoseERR_POSTGRES_CONNECTION_REFUSEDfailures are environmental here, not from this change.I'm an engineer on the OrcaRouter team.
Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter