Skip to content

workers-ai-provider rejects the Unified Billing moonshotai/Kimi catalog slug before AI.run #634

Description

@kalepail

Note

Automated notice: This issue was filed from Stellar Raven's automated evaluation pipeline. Evidence and a public source record are included below. The finding may still be incomplete or incorrect — please verify against the live surface before acting on it.

Finding

workers-ai-provider 4.0.0 cannot delegate the Unified Billing catalog slug
moonshotai/kimi-k3 when provider plugins are configured. The 26-entry gateway
registry omits moonshotai, so model construction throws
Unknown gateway provider "moonshotai" (from slug "moonshotai/kimi-k3") before
AI.run can dispatch it. The current npm latest is also 4.0.0, so this is not
an upgrade-only issue.

Evidence

Minimal reproduction (no network call):

import { createWorkersAI } from "workers-ai-provider";
import { openai } from "workers-ai-provider/openai";

let calls = 0;
const binding = { async run() { calls++; throw new Error("should not run"); } };
const workersai = createWorkersAI({ binding, providers: [openai], resume: false });

workersai("moonshotai/kimi-k3");
// GatewayDelegateError: Unknown gateway provider "moonshotai" ...
// calls === 0

Expected: the slug selects the run transport and reaches binding.run, as it does
when providers is omitted. Actual: the delegate rejects it during registry
resolution. Raven keeps a second, providers-less instance solely for this prefix;
that sacrifices the provider-SDK normalization and gateway-delegate features for
Kimi while the primary instance remains configured for other vendors.

Additional recorded evidence:

  • workers-ai-provider 4.0.0 installed from npm (latest dist-tag, verified 2026-08-06)
  • deterministic local reproduction: createWorkersAI({ binding, providers: [openai], resume: false })("moonshotai/kimi-k3") throws before the mock binding's run is called (0 calls)
  • registry exports 26 entries; moonshotai is absent, while findProviderBySlug("moonshotai") returns undefined
  • source: node_modules/workers-ai-provider/src/gateway-delegate.ts:112-120 resolves slugs and throws the reproduced error
  • consumer impact: src/demo/model-config.ts:148-164 and src/demo/chat.ts:315-360 need a separate providers-less createWorkersAI instance to use the binding run path

Recommendation

Add a moonshotai registry entry for the Unified Billing run catalog using the
OpenAI wire format (the default runWireFormat) and mark it as having no native
gateway path unless Cloudflare supports one. This keeps the existing delegate
behavior for configured providers and removes the separate binding instance.

Source Record

This was found by the downstream Raven eval/improvements loop and recorded as wai-001 (workers-ai-provider, discovered 2026-08-06).

Public source record: improvements/workers-ai-provider/wai-001-moonshotai-catalog-slug-registry.md

Immutable source snapshot: 4e2c3dbfad4a

Resolution Handoff

When a fix is deployed, please link the resolving issue or PR to the source record above and notify Raven through:

https://github.com/stellar-experimental/stellar-raven/issues/new?template=upstream-improvement-ready.yml&title=%5Bupstream-ready%5D%20wai-001%3A%20

Include the finding id, resolving issue/PR, deployed version or timestamp, and the smallest live recheck. Raven independently verifies the upstream surface before changing the finding to fixed-upstream; issue closure or a merged PR alone is not treated as proof. After a distinct reviewer repeats the live check, the active finding is retired to Raven's resolved ledger; a commit-pinned snapshot is preserved when available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions