Skip to content

feat: recognize OrcaRouter as a named AI provider in dashboard analytics - #4798

Closed
armyluki-wq wants to merge 1 commit into
triggerdotdev:mainfrom
armyluki-wq:feat/add-orcarouter-provider
Closed

feat: recognize OrcaRouter as a named AI provider in dashboard analytics#4798
armyluki-wq wants to merge 1 commit into
triggerdotdev:mainfrom
armyluki-wq:feat/add-orcarouter-provider

Conversation

@armyluki-wq

Copy link
Copy Markdown

Trigger.dev is the open-source platform for building AI workflows in TypeScript, and its run analytics already treats OpenAI-compatible gateways as first-class citizens: OpenRouter spans get a resolved downstream provider, provider-reported usage cost, and a model-filter icon derived from the model prefix.

This PR gives OrcaRouter the same treatment. OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding orcarouter as a first-class provider 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.

The changes mirror the existing openrouter handling in four spots:

  • aiHelpers.ts: resolve resolvedProvider from orcarouter.provider span metadata
  • enrichCreatableEvents.server.ts + admin.llm-models.missing.$model.tsx: extract orcarouter.usage.cost as provider-reported cost
  • ModelsFilter.tsx: derive the model-filter icon from the model prefix for orcarouter
  • added a unit test mirroring the OpenRouter cost-preference case

Verification

  • oxfmt --check and oxlint clean on all changed files
  • New unit test for orcarouter cost extraction (mirrors existing openrouter tests)
  • Live-tested the OrcaRouter endpoint: GET /v1/models and POST /v1/chat/completions return 200, with usage cost in provider metadata

I'm an engineer on the OrcaRouter team.

Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter

Add first-class recognition for OrcaRouter alongside the existing
gateway/OpenRouter handling: resolve the downstream provider from
`orcarouter.provider` span metadata, extract provider-reported usage
cost, and derive the model-filter icon from the model prefix.

This mirrors the OpenRouter integration so OrcaRouter runs show the
same provider/cost fidelity in the dashboard instead of being treated
as anonymous custom endpoints.
@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3d5535a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hi @armyluki-wq, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Aug 27, 2026
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ab69b07-4caa-4cac-aa13-16582a1d98a0

📥 Commits

Reviewing files that changed from the base of the PR and between c7f78e4 and 3d5535a.

📒 Files selected for processing (9)
  • .server-changes/orcarouter-ai-runs-provider-and-cost.md
  • apps/webapp/app/components/metrics/ModelsFilter.tsx
  • apps/webapp/app/components/runs/v3/ai/aiHelpers.ts
  • apps/webapp/app/components/runs/v3/ai/types.ts
  • apps/webapp/app/routes/admin.llm-models.missing.$model.tsx
  • apps/webapp/app/services/admin/missingLlmModels.server.ts
  • apps/webapp/app/v3/querySchemas.ts
  • apps/webapp/app/v3/utils/enrichCreatableEvents.server.test.ts
  • apps/webapp/app/v3/utils/enrichCreatableEvents.server.ts

Walkthrough

The webapp now recognizes OrcaRouter metadata when resolving downstream providers for AI runs and model icons. It extracts positive costs from OrcaRouter usage metadata in run enrichment and admin missing-model data. Metric descriptions now list OrcaRouter as a cost source. A test verifies that OrcaRouter-reported cost takes precedence over catalog pricing. A changelog entry documents the feature.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Warning

⚠️ This pull request has been flagged as potential spam (promotional) by CodeRabbit slop detection and should be reviewed carefully.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant