Skip to content

[plugins] Anthropic Python: dynamic model listing via beta.models.list with static fallback #5633

Description

@hilariie

Parent: #5617 (Phase B, P1: item 19)

Why

Model discovery is static: listing only returns the hard-coded set. New or access-gated models (including ones intentionally kept out of the static set, like claude-fable-5 and claude-mythos-5; see item 18, #5626) never appear in reflection until someone edits the registry by hand. JS lists models from the API to capture both stable and beta; Go does the same with a short cache.

This keeps the plugin current without code changes and lets approved accounts see the models they actually have access to. It pairs with the registry refresh (item 18, #5626).

What needs to be done

  • Discover available models from the Anthropic API (the listing that includes both stable and beta) and surface them, resolving each through the existing model-info / generic fallback so access-gated IDs appear for approved accounts.
  • Fall back to the static set when the API is unreachable. A short cache (Go uses ~1h) is reasonable.

Acceptance

  • Listing returns API-discovered models (stable + beta) when reachable, and falls back to the static set on error.
  • Tests cover the dynamic path (mocked) and the static fallback.

Reference

  • Current static listing: py/plugins/anthropic/src/genkit/plugins/anthropic/plugin.py:131-146.
  • JS target: js/plugins/anthropic/src/list.ts:37 (beta.models.list()).

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions