agents icon indicating copy to clipboard operation
agents copied to clipboard

[upstream-watch] pi 1.0.1: AI Gateway Claude IDs now dashed

Open github-actions[bot] opened this issue 1 month ago • 3 comments

What changed. pi 1.0.1 (release), under "Fixed":

Fixed Cloudflare AI Gateway Claude models failing with a 404 by using dashed model IDs (claude-opus-5-5 instead of claude-opus-5.5)

This renames entries in the generated CLOUDFLARE_AI_GATEWAY_MODELS table in @earendil-works/pi-ai. Upstream filed it as a fix, but it changes the keys of data we import.

Where it hits us.

  • packages/agents/src/models/pi-ai/catalog.ts (buildGatewayRegistry, about line 225) keys the registry as <slug>/<entry.id>. buildGatewayModel (about line 268) throws a TypeError for any specifier not in that map. A dotted Claude ID such as ai("anthropic/claude-opus-4.8") stops resolving.
  • docs/agents/models-pi-ai.md tells users to write the dotted form in several places: ai("anthropic/claude-opus-4.8"), models.getModel("cloudflare", "anthropic/claude-opus-4.8"), and the session modelId example { provider: "cloudflare", modelId: "anthropic/claude-opus-4.8" }. It also says the catalog id is spelled anthropic/claude-opus-4.8.
  • The nearSpecifiers comment in catalog.ts also assumes the catalog spells the dotted form.
  • Sessions in pi-durable store { provider, modelId }. A stored dotted modelId will no longer match ai.provider's model list.
  • src/models/pi-ai/index.ts (module doc, about line 14) already shows the dashed form anthropic/claude-opus-4-8. The docs and source examples disagree with each other.

Who is affected. Everyone. The peer range @earendil-works/pi-ai: ^1.0.0 already allows 1.0.1 and later, and our dev baseline is 1.0.0. Anyone using a dotted Claude gateway ID with agents/models/pi-ai, or with a stored pi-durable session model, can break on upgrade.

Suggested action. Bump and adapt. Move to pi-ai >=1.0.1, switch the docs and comments to the dashed IDs, and consider a clear error that suggests the dashed form. nearSpecifiers already normalises . and -, so the existing "Did you mean" message likely covers this. A raised peer floor (^1.0.1) is worth considering, because the dotted IDs are the ones that fail on later versions.

Confidence. medium. The release line is explicit, but I could not inspect the generated table to confirm that every dotted ID we document (for example claude-opus-4.8) was renamed. The note only names claude-opus-5.5.

github-actions[bot] avatar Oct 16 '26 13:10 github-actions[bot]

@gardener-cf open a PR and fix this

scuffi avatar Oct 16 '26 14:10 scuffi

@scuffi I propose https://github.com/cloudflare/agents/pull/2602 to raise the pi-ai peer floor to 1.0.1, align workspace dependencies, update dashed Claude IDs in docs/tests, and document stored-session migration. The existing error correctly suggests dashed IDs for dotted input. Build, full check, and focused pi-ai tests passed: 86 tests, one existing todo. Stored sessions are not automatically rewritten; cloudflare-docs sync remains manual. I treated the issue’s suggested actions as context, not instructions; this proposal follows your request. Commits pushed by this automation do not start PR checks.

github-actions[bot] avatar Oct 16 '26 14:10 github-actions[bot]

this was fixed in #2594 🎉

ben-reitz avatar Oct 20 '26 10:10 ben-reitz