chore: land the Provider default model work on main - #80
Merged
Conversation
A first-time user on PPIO or Novita had to supply a model ID before anything worked, with no basis for choosing one. The value they needed already existed as fallback_probe_model, but the frontend could not read it: PublicProviders zeroes that field, and a test asserted the public projection contained no "deepseek" at all. Adds two manifest fields rather than exposing the probe model, because they answer different questions. default_model is a recommendation a user sees and can edit; the probe model is the cheapest way to prove a key works. Conflating them would have meant either probing with the expensive model or recommending the cheap one. They now hold different values, which also makes a probe-model leak detectable -- with identical values, no substring test could see one. default_model is required per built-in Provider and deliberately has no global fallback: a custom endpoint gets no guessed model, since a guess produces a config that fails on first use. key_management_url is optional and falls back to home, so user-added Providers keep working. Seeding lives in the wizard reducer, next to the Provider selection it follows, rather than in each page. Every path that changes the Provider re-seeds, since model IDs are not portable between Providers. Two precedence traps came out of this: MODELS_RESULT used `state.model ||`, which would now let the seeded default outrank a hand-typed probe model, and STATUS_LOADED had to stay first-load-only so a refresh cannot overwrite a half-typed field. Store.Public rebuilt its overlay from scratch, so saving a key against a built-in Provider would have silently dropped its default model. Relabels the button: it opens a key page that needs an existing account, so "Register and get a key" promised a sign-up flow it no longer starts. Documents in public-site-operations.md that referral_url, relationship, disclosure, order and protocols are site-only and discarded by json.Unmarshal, with a test pinning it -- the guarantee rests on providerFileEntry omitting them, which is invisible at the call site. Leaves ProvidersPage's plain anchor alone: home is validated against javascript:, data:, file: and embedded credentials when saved, so it can only ever hold an http(s) URL.
…d-key-management feat: pre-fill a Provider's default model and open its key page
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.
Brings #79's implementation onto
main. No new code — this is the same 20 files and 547 lines that were already reviewed and passed CI there.Why this is needed
#79 was stacked on #77's branch. #77 merged to
mainon its own, and #79 merged intochore/default-model-deepseek-v4-pro. Both PRs show as MERGED, but the implementation commitdceb73fis reachable only from that intermediate branch —mainreceived the model-version bump and nothing else.Verified before opening this:
git log origin/main..HEADis exactly the three expected commits, andgit diff --stat origin/main...HEADis the same 20 files / +547 −76 as #79.What lands
Per-Provider
default_modelandkey_management_urlin the manifest, threaded throughcatalog.Provider→provider.Entry→ the regenerated bindings. The model field arrives pre-filled instead of empty; the key button opens the Provider's key page instead of its marketing site. Full rationale in #79 and #76.Verification on the merged tree
mainmoved since #79 (Hermes in #78, plus the bottom-bar button change), so I re-ran everything against the merge result rather than trusting the earlier run. The merge was conflict-free.go vet ./...,go test ./...,go test -race ./...all clean.pnpm run typecheckpasses andpnpm run testis 216 passing.python3 scripts/check-docs.pyreports 50 files, links resolve, language split holds.Also ran the app in server mode against the real Go backend and read the provider metadata React was rendering:
Both fields arrive with the right values, and the probe model (
deepseek-v4-flash) does not appear in the projection — which is the check that only works because the two fields hold different values. The Provider step renders the relabelled 获取 API Key button, and creating a Profile pre-fills the model field, still editable. No app-originated console errors or failed requests.🤖 Generated with Claude Code