You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
createAiSdkExecutors and createTanStackAiExecutors accept a machine or setup - #155
AI SDK and TanStack AI executors can now use models declared in an agent setup, setup result, or machine. Existing options-based model configuration remains supported.
Added guidance and examples for configuring and reusing models across both adapters.
Bug Fixes
Unsupported inputs, including setups or machines without declared models, now produce descriptive errors when executors are created.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: a8c834d0-dcd6-417d-be83-a0843bb7ed92
📥 Commits
Reviewing files that changed from the base of the PR and between 7577d20 and 14dca89.
📒 Files selected for processing (9)
.changeset/adapters-read-setup-models.md
docs/models-and-providers.md
docs/quickstart.md
readme.md
src/ai-sdk/index.test.ts
src/ai-sdk/index.ts
src/internal/model-source.ts
src/tanstack-ai/index.test.ts
src/tanstack-ai/index.ts
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
📝 Walkthrough
Walkthrough
Both executor adapters now accept a setup result or configured machine as a model source, alongside the existing options form. A shared resolver normalizes supported inputs and throws for unsupported inputs or missing models. Tests and documentation cover the new inputs.
Changes
Executor model sources
Layer / File(s)
Summary
Normalize model sources src/internal/model-source.ts
A shared resolver accepts options containing models, setup results with models, and configured machines with models. It throws a descriptive TypeError for unsupported inputs.
Integrate model sources in both adapters src/ai-sdk/index.ts, src/ai-sdk/index.test.ts, src/tanstack-ai/index.ts, src/tanstack-ai/index.test.ts
Both adapters add a machine overload and resolve supported inputs before executor construction. Tests cover accepted sources and construction errors.
Update examples and release notes docs/models-and-providers.md, docs/quickstart.md, readme.md, .changeset/adapters-read-setup-models.md
Examples show setup-declared models and preserve the options form for host-owned model maps. The documentation and changeset describe accepted inputs and construction-time errors.
sequenceDiagram
participant Host
participant AiSdk as createAiSdkExecutors
participant TanStack as createTanStackAiExecutors
participant Resolver as resolveModelSource
alt AI SDK adapter
Host->>AiSdk: Pass setup result, machine, or options
AiSdk->>Resolver: Resolve model source
Resolver-->>AiSdk: Return executor options
AiSdk-->>Host: Return AiSdkExecutors
else TanStack AI adapter
Host->>TanStack: Pass setup result, machine, or options
TanStack->>Resolver: Resolve model source
Resolver-->>TanStack: Return executor options
TanStack-->>Host: Return TanStackAiExecutors
end
Loading
Suggested reviewers:claude
Merge Risk:⚪ Minimal · up to 14dca
The documented setup-result input remains supported; no identified issue blocks merging after normal checks.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 5 files. (4 skipped: 4…
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: both executor factories now accept a machine or setup.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 5 files. (4 skipped: 4 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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
createAiSdkExecutors(machine)/createAiSdkExecutors(agentSetup)read themodelsdeclared insetupAgent({ models })via the existing registry (src/internal/registry.ts).{ models }/{ resolveModel }still work. Same forcreateTanStackAiExecutors. OpenAI adapter skipped (different shape:{ client, resolveModel }).Behaviour changes
createAiSdkExecutors({})now throws at construction instead of on first call.models: {}throws; the literal{ models: {} }still passes.Verify
pnpm vitest --run src (667 tests), typecheck, lint, format:check, docs:check all pass.
Summary by CodeRabbit
New Features
Bug Fixes