Skip to content

fix(web): editing a credential's base URL or model updates the catalog rows inference uses (CL-8591) - #946

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-8591-credential-edit-rewires
Sep 18, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-8591-credential-edit-rewires

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The Credentials edit dialog wrote base URL/model into the credential's own opaque 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.
  • The dialog now finds the credential's linked model-provider (by credentialId) and patches that provider's baseURL directly. A model change mints a sibling offering and redeploys Myra onto it before retiring the old offering, since a deployed Myra run pins sourceOfferingIds in 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: dropped metadata from UpdateCredentialInput — name/description only.
  • apps/web/src/settings/inference/api.ts: added updateModelProviderBaseURL (stock PATCH /catalog/providers/:id) and mintOfferingForModel (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); added deleteOwnOffering.
  • apps/web/src/settings/myra-model-redeploy.ts (new): redeployMyraForModelChange reuses the existing client deploy path (myra-deploy.ts's deployMyraSource, then the stock POST /workflows/deployments) with one offering id swapped for the new one in Myra's existing sourceOfferingIds/declaredSources; swapDeclaredOffering is the pure mapping this does. Returns false (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: resolveExistingOffering takes an optional fetchImpl so the redeploy path (and its tests) can be exercised without the global fetch.
  • Unit tests: mintOfferingForModel's no-op-vs-mint branching (and that it never deletes), and swapDeclaredOffering's id/default/order-preserving swap.

Testing

  • bun run check (typecheck, lint, fmt, full test suite) passes.
  • Live verification against a running dev stack was not completed in this environment (no outbound network access from the sandbox); the reviewer should confirm the provider PATCH and the model-change redeploy fire correctly, and that Settings → Inference reflects the new model, before merge.

@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8591

@TheGreatAxios
TheGreatAxios merged commit 6a99d16 into main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant