fix(web): editing a credential's base URL or model updates the catalog rows inference uses (CL-8591) - #946
Merged
Conversation
…the old offering (CL-8591)
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
metadata, but inference resolves the base URL from the model-provider row and the model from the offering's model row — an edit changed nothing Myra actually calls.credentialId) and patches that provider'sbaseURLdirectly. A model change mints a sibling offering and redeploys Myra onto it before retiring the old offering, since a deployed Myra run pinssourceOfferingIdsin its stock launch spec and the allocation service re-resolves by those exact ids — deleting the old offering first would leave a live run pointing at a dead one.Changes
apps/web/src/settings/credentials-api.ts: droppedmetadatafromUpdateCredentialInput— name/description only.apps/web/src/settings/inference/api.ts: addedupdateModelProviderBaseURL(stockPATCH /catalog/providers/:id) andmintOfferingForModel(mints/reuses a model row for the new tag and creates a sibling offering at the same priority — it never deletes the old offering itself); addeddeleteOwnOffering.apps/web/src/settings/myra-model-redeploy.ts(new):redeployMyraForModelChangereuses the existing client deploy path (myra-deploy.ts'sdeployMyraSource, then the stockPOST /workflows/deployments) with one offering id swapped for the new one in Myra's existingsourceOfferingIds/declaredSources;swapDeclaredOfferingis the pure mapping this does. Returnsfalse(nothing to redeploy) when Myra isn't declaring the old offering at all; throws without touching either offering if the redeploy itself fails.apps/web/src/settings/credentials-section.tsx: the edit dialog loads the tenant's own catalog providers/offerings/models alongside credentials, shows base URL/model fields only when the credential has a linked provider, patches the provider directly for base URL, and for a model change mints the new offering, redeploys Myra onto it, then deletes the old offering only once the redeploy succeeds. Dialog copy notes a model change restarts Myra.reload()also invalidates the Inference settings section's query key.apps/web/src/onboarding/provider-connect-step.tsx:resolveExistingOfferingtakes an optionalfetchImplso the redeploy path (and its tests) can be exercised without the globalfetch.mintOfferingForModel's no-op-vs-mint branching (and that it never deletes), andswapDeclaredOffering's id/default/order-preserving swap.Testing
bun run check(typecheck, lint, fmt, full test suite) passes.