fix(workbench): require models when adding providers - #458
Conversation
|
Your Claude subscription has hit its usage limit. It resets at 11am (UTC). Re-trigger Pullfrog after the reset, or add an Add repo secret → · Model settings → · Setup docs → · Ask in Discord →
|
PeronGH
left a comment
There was a problem hiding this comment.
Verified the constraint is UI-only: models stays z.array(AccountModelSchema).optional() in packages/foundation/schema/src/model/account.ts, so existing zero-model accounts remain valid and no wire/schema change is implied. Edit mode correctly keeps the looser CustomDraftSchema, so the requirement can't retroactively block editing an old account.
Traced the gateway path against linkcodehq, since it's the one flow that gains a network dependency mid-creation: modelListSource('linkcode-gateway') resolves to gateway.linkcode.ai/v1/models, which serves the compile-time MODEL_CATALOG constant (75 models across four bundled provider manifests) with no DB read or upstream call, and auth is a strongly-consistent better-auth verifyApiKey against the same DB createKey just wrote to. So the probe can't return empty and has no failure mode createKey doesn't already have — the models.length === 0 throw is a safety net rather than a reachable path. Caching the minted key in createdKey so a retry doesn't mint a second one is the right call.
One non-blocking note: a network failure strictly between createKey and the probe response leaves a gateway key minted with no account attached if the user then closes the dialog. Pre-existing shape of the flow, slightly widened — worth a follow-up only if orphaned keys show up in practice.

Summary
Linear: CODE-589
Verification
pnpm check:cipnpm test— 2964 passed, 1 skippedChecklist
pnpm check:ciandpnpm testboth pass (pluscargo fmt/clippy/testfor Rust changes)WIRE_PROTOCOL_VERSIONis bumped (not applicable; no wire change)