Repository navigation
feat(providers): google/ model prefix, vendor routes on unknown prefixes, doctor ai@5 hint - #662
Merged
Merged
Conversation
…xes, doctor ai@5 hint - `google/<model>` resolves to a new GoogleProvider backed by the optional peer @ai-sdk/google (^1.2.0 / ^3.0.0 / ^4.0.0 for ai 4 / 6 / 7), reading GOOGLE_GENERATIVE_AI_API_KEY. Covered by init, doctor (pairing, key, --ping), the missing-peer hint, and the Worker entry shim. - An unknown prefix now suggests openrouter/<vendor>/<model>, pi/<vendor>/<model> when pi serves the vendor, and fromAiSdk(). - `lousho doctor` fails an installed ai 5 with an upgrade hint; README notes the supported ai majors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
feat/provider-google-prefix
branch
from
October 16, 2026 20:50
a26177e to
adfb9cc
Compare
This was referenced Oct 16, 2026
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.
Problem
resolveProvider('google/gemini-2.5-flash')andcreateAgent({ model: 'google/...' })threwunrecognized provider 'google', because the only prefixes were openai, anthropic, openrouter, ollama, pi and mock. Competing SDKs accept any provider/model string. For any other vendor the error listed the prefixes and stopped there, without saying how to reach that vendor. Separately, an installedai@5(not supported) only got the generic peer-range failure inlousho doctor.Fix
google/prefix: newGoogleProvider, built the same way as the OpenAI and Anthropic providers. It lazily loads the optional peer@ai-sdk/googlethroughloadOptionalPeer(), pinned peraimajor:^1.2.0for ai 4,^3.0.0for ai 6,^4.0.0for ai 7. It readsGOOGLE_GENERATIVE_AI_API_KEY. The peer is wired into:PROVIDERStable, so it gets the missing-key error, the per-major install hint forLOUSHO_PEER_MISSING, env detection and the doctor checks for pairing and key--ping, which sends the key in thex-goog-api-keyheaderlousho init --provider google, specToAgent and the node-server provider detectiontypings/optional-peers.d.ts,peerDependencies+peerDependenciesMeta.optional, and fallowignoreDependencies/workerentry it is shimmed with a coded failure, and in the cloudflare adapter it stays external. Google is not a Worker provider, the same as ollama and pi.openrouter/<vendor>/<model>,pi/<vendor>/<model>(only when pi-ai serves that vendor; a test checks the list against pi-ai'sgetProviders()), andcreateAgent({ provider: fromAiSdk(<vendor>('<model>')) }). A vendor that pi serves is never shown as a typo, soxaiis no longer read as "did you mean pi". The[LOUSHO_PROVIDER_UNKNOWN] … (docs/errors.md#lousho_provider_unknown)help line is still appended, and its hint now mentions these routes.lousho doctorfailspeer.aiwith "AI SDK v5 is not supported" and an upgrade hint: move to ai 6 or 7 and the matching@ai-sdk/*major. The README Installation section now states the supportedaimajors.Verification
npx tsc --noEmit,npm run lint,npm run build(including the Worker entry): cleannpm run api:check,npm run docs:llms:check: up to datenpx vitest run src/cli src/providers src/spec src/deploy src/createAgent.test.ts src/utils: 1599 passed, 4 skipped. The new tests cover:GoogleProvider.test.ts) and absent (missingPeer.test.ts, the resolveProvider install hint)@ai-sdk/googlepairing and the Google pingnpm run typecheck:testsreports one error that already exists on main (src/tools/mcp/loadMcpTools.test.ts), not in this change.🤖 Generated with Claude Code