Repository navigation
feat(Decision): use AI SDK decisions, configure decision models in ai.decisionModel - #5742
Merged
Merged
Conversation
Replace hand-written fetch calls to OpenRouter/TypeSafe decision endpoints with AI SDK experimental_decide via @openrouter/ai-sdk-provider and @ai-sdk/typesafe-ai. Bumps ai to v7, which experimental_decide requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cisions Drop the decision provider option and @ai-sdk/typesafe-ai: all decision models, including TypeSafe Jev, are served by the OpenRouter Decisions API. Document how decisions use AI SDK experimental_decide and how to ask choice/score questions from a custom helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai.decisionModel.model and visualModel accept an OpenRouter model ID or an AI SDK decision model, e.g. createOpenRouter().evaluationModel(id). Document configuring decision models in ai.md; drop custom decisions section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai.decisionModel.model and visualModel must be AI SDK decision models created with createOpenRouter().evaluationModel(). Drop model ID strings, default models and apiKey option. @openrouter/ai-sdk-provider becomes a dev dependency; users install it like other AI SDK providers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai 7.0.133 wraps decision state into SDK parts that @openrouter/ai-sdk-provider 3.1.0 forwards untranslated, so OpenRouter receives wrapped state and screenshots lose the image_url format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Decision helper now uses AI SDK
experimental_decidewith decision models from the OpenRouter provider, replacing hand-writtenfetchcalls.Decision models are configured only one way, in
codecept.conf.js:I.decideVisuallyuses a separate model with image input, set asvisualModel: openrouter.evaluationModel('cloudflare/clef').Changes
ai.decisionModel.modelandvisualModeltake AI SDK decision models. If one is missing, the step fails with an error that shows the config above.booleanquestions.providerandapiKeyoptions;aiis bumped from^6to7.0.132(pinned), becauseexperimental_deciderequires v7. From 7.0.133 on,experimental_decidewraps state into SDK parts that@openrouter/ai-sdk-provider3.1.0 forwards untranslated, which breaks screenshot input. Unpin once the OpenRouter provider supports the new state format. Users who bring their own@ai-sdk/openaior@ai-sdk/anthropicforai.modelneed provider versions compatible withai@7.@openrouter/ai-sdk-provideris a dev dependency. Users install it themselves, like other AI SDK providers.maxRetries: 0), and the timeout still applies.DecisionConnectionError. HTTP errors fail the step and report the status and body.decideVisuallystill sends the screenshot.Docs
ai.md:model.visualModel.assertions.md: links to theai.mdconfig; options table updated.agents.md: links to theai.mdconfig.helpers/Decision.md: regenerated from the helper JSDoc.Test plan
npm run test:unit: 882 passed. Tests configure models withcreateOpenRouterand a fakefetch.🤖 Generated with Claude Code