Skip to content

feat(providers): expose usage-supported in provider plugin manifest - #12214

Merged
diegosouzapw merged 5 commits into
cheaper-inference:release/v3.8.51from
maxmad64bis:feat/usage-supported-capability
Sep 1, 2026
Merged

diegosouzapw merged 5 commits into
cheaper-inference:release/v3.8.51from
maxmad64bis:feat/usage-supported-capability

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Publish the second usage capability in the provider plugin manifest. The manifest already exposes usage-fetch (40 providers, #11903); this PR adds usage-supported so integrators can tell without reading TypeScript whether the server usage routes accept a provider.

  • New usage-supported tag in ProviderPluginCapability and capabilitiesFor() (open-sse/config/providerPluginManifest.ts).
  • USAGE_SUPPORTED_PROVIDERS extracted to a zero-import leaf src/shared/constants/providers/usageSupported.ts, re-exported from providers.ts (same move as fetcherProviders.ts in feat(providers): expose a usage-fetch capability in the provider plugin manifest #11903; the manifest graph stays light).
  • Docs docs/reference/PROVIDER_PLUGIN_MANIFEST.md: 8 tags, distinction between usage-fetch and usage-supported with the 7 measured differences.
  • No list mutation, no new route, schemaVersion stays 1.

usage-fetch resolves on id or alias (the dispatcher accepts both); usage-supported resolves on id alone — the runtime guard does USAGE_SUPPORTED_PROVIDERS.includes(providerId) with no alias resolution (src/shared/utils/providerQuotaVisibility.ts, src/lib/usage/providerLimits.ts:isSupportedUsageConnection), so the manifest keeps the same rule.

The two scopes differ: 42 providers carry both tags, 4 carry only usage-fetch (opencode, opencode-zen, openrouter, xai) and 3 only usage-supported (adobe-firefly, firefly, xiaomi-mimo-token-plan) — 7 differences in total, so one tag does not imply the other.

Related Issues

Validation

  • Change type: provider
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward — base upstream/release/v3.8.51 (63e4afa32)
  • Production-code changes include a new or updated automated test in this PR
  • check:cycles — pass (import-free leaf, no cycles)
  • check:docs-sync / check:doc-links / check:changelog-integrity — pass (changelog.d/features/12214-usage-supported-capability.md added — reviewer-flagged gap, mirrors 11903)

Tests Added Or Updated

  • tests/unit/provider-plugin-manifest.test.ts — 3 tests added (mirrors of feat(providers): expose a usage-fetch capability in the provider plugin manifest #11903, asserting against the real list):
    • advertises usage-supported for a listed provider
    • omits usage-supported for a provider not in the list
    • usage-supported matches on id only, not alias (and diverges from usage-fetch, which does match on alias)
  • No other test file changed. The ~20 files importing USAGE_SUPPORTED_PROVIDERS via providers.ts stay untouched thanks to the re-export.

Coverage Notes

Touches src/ and open-sse/. Covered by tests/unit/provider-plugin-manifest.test.ts and the ~20 existing suites on USAGE_SUPPORTED_PROVIDERS / isSupportedUsageConnection / supportsProviderQuota (e.g. provider-quota-visibility, adobe-firefly, command-code-usage, firecrawl-usage). No coverage drop expected on the touched files.

Reviewer Notes

@maxmad64bis
maxmad64bis marked this pull request as ready for review August 31, 2026 18:16
Publish the second usage capability from cheaper-inference#11722. The manifest now
advertises usage-supported alongside usage-fetch so integrators can
tell whether the server usage routes accept a provider without reading
TypeScript. USAGE_SUPPORTED_PROVIDERS moves to a zero-import leaf
(src/shared/constants/providers/usageSupported.ts) and is re-exported
from providers.ts, mirroring the fetcherProviders leaf from cheaper-inference#11903 and
keeping the manifest a light module.

usage-fetch resolves on id or alias (dispatcher accepts both);
usage-supported resolves on id alone, matching the runtime guard
(USAGE_SUPPORTED_PROVIDERS.includes with no alias resolution). 7
differences prove the two notions are distinct (42 shared, 4
fetcher-only, 3 supported-only).
diegosouzapw and others added 2 commits September 1, 2026 12:09
…base

Carry kilocode into the extracted USAGE_SUPPORTED_PROVIDERS leaf and keep
the list as string[] so .includes(providerId) type-checks. Drop the unused
UsageSupportedProvider type (knip dead-code).
Update the changelog count to 46 (kilocode) and drop stale
usage-fetch vs usage-supported perimeter examples.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Babysit (/sweep-reds round 3, Fase B) — not merging.

Reds before: Fast Quality Gates (dead-code, open-sse-typecheck, check:dashboard-typecheck), API Route Typecheck. Merge conflicts vs release/v3.8.51.

Action:

  • Merged origin/release/v3.8.51 (dfa241d89e).
  • Carried kilocode into the extracted USAGE_SUPPORTED_PROVIDERS leaf.
  • Dropped unused UsageSupportedProvider + as const so .includes(providerId: string) type-checks (fixes knip + TS2345 in providerLimits.ts / ProviderQuotaWidget.tsx / providerQuotaVisibility.ts).
  • Docs/changelog count aligned to 46 (5c496e6447).

Local signal: tests/unit/provider-plugin-manifest.test.ts 10/10 pass.

CI running on 5c496e6447.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Follow-up: original API Route Typecheck is green on this run.

New reds after the merge-refresh are inherited from release/v3.8.51, not this PR's usage-supported diff:

Not fixing those inside this contributor branch (base-red belongs in a fix/release-v3.8.51-basereds PR). Fast Quality Gates still running.

…kspace boundary)

The manifest lives in open-sse and may not import from src/ (the open-sse
typecheck gate). Same pure-data leaf pattern as fetcherProviders.ts (cheaper-inference#11903):
open-sse/services/usage/supportedProviders.ts owns the list (typed readonly
string[] so .includes(string) keeps compiling), and src/shared/constants/
providers.ts re-exports it so every existing import path is unchanged. The
dead UsageSupportedProvider type is gone; the list matches the current base
(kilocode included — openrouter/devin-cli arrive with cheaper-inference#12256, which needs a
re-sync onto whichever of the pair lands first).
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Holding this one rather than merging it, and I want to be explicit about why.

I had prepared a reconciliation for the base drift here: the branch forked 46 commits before kilocode joined USAGE_SUPPORTED_PROVIDERS, so taking the branch's providers.ts wholesale would have silently dropped it — 45 ids instead of 46. My push was rejected as non-fast-forward, which is exactly the guard doing its job: the branch had moved.

Checking what landed, the same gap was already handled here, and better — the leaf moved to open-sse/services/usage/supportedProviders.ts for the workspace boundary, and I verified parity against the current release tip: 46 ids on both sides, nothing lost, kilocode included.

Since another session is actively working this branch (commits from both @maxmad64bis and the maintainer account within the last hours), I'm leaving the merge to whoever owns that work rather than racing it. The PR is OPEN and MERGEABLE.

For the record, the rest of your batch landed: #12321, #12319, #12314, #12316, #12318, #12215, #12151, #12218, #12320, and #12317 is in flight.

@diegosouzapw
diegosouzapw merged commit c9f9b62 into cheaper-inference:release/v3.8.51 Sep 1, 2026
11 of 16 checks passed
diegosouzapw added a commit to Neuron-Mr-White/OmniRoute that referenced this pull request Sep 1, 2026
…base

Re-home openrouter + devin-cli onto the USAGE_SUPPORTED_PROVIDERS leaf
introduced by cheaper-inference#12214.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@maxmad64bis
maxmad64bis deleted the feat/usage-supported-capability branch September 24, 2026 21:11
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…heaper-inference#12214)

The provider plugin manifest already exposed usage-fetch (40 providers, cheaper-inference#11903); this publishes the second capability, usage-supported, so integrators can tell without reading TypeScript whether the server usage routes accept a provider. cheaper-inference#11903 closed cheaper-inference#11722 after shipping only half of it and said so at the time — this is the follow-up it promised.

The two scopes genuinely differ and the docs now say how: usage-fetch resolves on id or alias (the dispatcher accepts both), usage-supported on id alone, because the runtime guard does a plain USAGE_SUPPORTED_PROVIDERS.includes(providerId) with no alias resolution. 42 providers carry both tags, 4 carry only usage-fetch (opencode, opencode-zen, openrouter, xai) and 3 only usage-supported (adobe-firefly, firefly, xiaomi-mimo-token-plan) — 7 measured differences, so neither tag implies the other. No list mutation, no new route, schemaVersion stays 1.

USAGE_SUPPORTED_PROVIDERS moved out of src/shared/constants/providers.ts into an import-free leaf at open-sse/services/usage/supportedProviders.ts, keeping the manifest's import graph light — the same move fetcherProviders.ts got in cheaper-inference#11903, landed on the correct side of the workspace boundary.

Base note: the branch forked 46 commits before kilocode joined the list, so a wholesale take of its providers.ts would have silently dropped that id. Verified against the current release tip before merging — both sides hold the same 46 ids, nothing lost.

Verified on the current tip: typecheck:core clean, check:cycles OK across 417 files (the import-free-leaf claim holds), and 63/63 focused tests across provider-plugin-manifest, usage-fetcher-registration-coverage, adobe-firefly and agentrouter-quota-dashboard-rendering.

Thanks @maxmad64bis — and for finishing the half of cheaper-inference#11722 that was left open rather than letting it sit.
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.

feat(providers): expose a usage-fetch capability in provider-plugin-manifest

2 participants