[upstream-watch] pi 1.0.1: AI Gateway Claude IDs now dashed
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-5instead ofclaude-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 aTypeErrorfor any specifier not in that map. A dotted Claude ID such asai("anthropic/claude-opus-4.8")stops resolving.docs/agents/models-pi-ai.mdtells 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 sessionmodelIdexample{ provider: "cloudflare", modelId: "anthropic/claude-opus-4.8" }. It also says the catalog id is spelledanthropic/claude-opus-4.8.- The
nearSpecifierscomment incatalog.tsalso assumes the catalog spells the dotted form. - Sessions in pi-durable store
{ provider, modelId }. A stored dottedmodelIdwill no longer matchai.provider's model list. src/models/pi-ai/index.ts(module doc, about line 14) already shows the dashed formanthropic/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.
@gardener-cf open a PR and fix this
@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.
this was fixed in #2594 🎉