Skip to content

core: expose v2 model listing API#25821

Open
thdxr wants to merge 11 commits intodevfrom
feature/v2-plugin-model-api
Open

core: expose v2 model listing API#25821
thdxr wants to merge 11 commits intodevfrom
feature/v2-plugin-model-api

Conversation

@thdxr
Copy link
Copy Markdown
Member

@thdxr thdxr commented May 5, 2026

Summary

  • Exposes a v2 model listing endpoint so clients can discover available AI models programmatically.
  • Includes model pricing, capability, provider, and variant details in the generated JavaScript SDK.
  • Aligns v2 model naming around ModelV2 so session events and messages use the same schema identity.

Testing

  • Not run; commit was created before this PR request.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

thdxr added 11 commits May 7, 2026 00:57
- Detect and migrate v1 auth.json to auth-v2.json automatically
- Ensures users with existing auth files don't lose their credentials
- Validates OPENCODE_AUTH_CONTENT env var and migrates if needed
…nstead of hardcoded priorities

Small models are now automatically selected based on output cost rather than
maintaining hardcoded provider-specific priority lists. This ensures users
always get the most cost-effective option without manual configuration updates
when providers change pricing or add new models.

Also adds alphabetical sorting to debug v2 output for easier navigation and
improves plugin hook observability with span tracing.
Change plugin registration from direct hooks to lazy effect evaluation.
Plugins now use PluginV2.define() which wraps the hooks in an Effect,
allowing dependencies to be injected at registration time rather than
at definition time. This enables plugins to depend on services like
Catalog and Auth without explicit wiring in each provider file.
…re reliable multi-provider AI support

Adds 35 test files covering all supported AI providers in the v2 plugin system.
This ensures users can reliably switch between providers like OpenAI, Anthropic,
Google, Azure, and others without runtime errors. Each provider is tested for
correct API endpoint selection, authentication handling, and SDK integration.
@thdxr thdxr force-pushed the feature/v2-plugin-model-api branch from 8d4a667 to 7a19cac Compare May 7, 2026 04:58
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.

1 participant