feat(model-providers): add DELETE endpoint to permanently remove a provider - #501
Open
kristopolous wants to merge 1 commit into
Open
feat(model-providers): add DELETE endpoint to permanently remove a provider#501kristopolous wants to merge 1 commit into
kristopolous wants to merge 1 commit into
Conversation
…ovider Settings > Models has a "Remove" button for each configured provider, gated on modelCatalog.deleteModelProvider — but that's never implemented (no backend route), so the button silently never renders. Same gap as the MCP connector (truefoundry#494/truefoundry#495) and skill (truefoundry#498/truefoundry#499) work. Add IModelProviderStore.deleteProvider for both Postgres and SQLite, the DELETE route, and its handler. Same pattern: idempotent, 200 with {} on success. Backend only, same reason as truefoundry#495/truefoundry#499: packages/trueforge-sdk is Fern-generated in CI and fork PRs cannot receive that regen commit. Frontend wiring (modelProviderCatalog.ts's deleteModelProvider) is a fast-follow once this merges and the SDK regenerates on main. Fixes truefoundry#500 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba
kristopolous
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
August 29, 2026 22:53
🦋 Changeset detectedLatest commit: 2faf9a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6 tasks
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
Fixes #500.
In Settings → Models, each configured provider (openai, anthropic, custom, …) has a "Remove" button, gated on
modelCatalog.deleteModelProvider. That method is never implemented in the adapter — no backendDELETEroute exists for model providers at all — so the button silently never renders. Same shape as the MCP connector (#494/#495) and skill (#498/#499) gaps.This PR adds
DELETE /api/v1/settings/model-providers/{name}.IModelProviderStore.deleteProviderimplemented for both Postgres and SQLite.deleteAgentRoute/deleteMcpServerRoute/deleteSkillRoutepattern exactly: idempotent,200with{}on success.Scope: backend only (same reason as #495/#499)
packages/trueforge-sdkis Fern-generated in CI and can't receive that regen commit on a fork PR. So this is the backend endpoint only, tested. Frontend wiring (modelProviderCatalog.ts'sdeleteModelProvider) is a fast-follow once this merges and the SDK regenerates onmain.Test plan
modelProviderStoreContractSuite.ts(runs against both backends): delete removes the row; idempotent for an unknown provider, other tenants untouched.tests/unit/apis/modelProviders.test.ts:DELETE /model-providers/{name}removes the provider (and confirms it drops out of the list); idempotent for an unknown provider.pnpm test:store:sqlite— 133 passed (was 131), 1 skipped; confirmed the two newdeleteProvidercases ran via--verbose.pnpm test(trueforge unit suite) — 294/294 pass, including the two newmodelProviders.test.tscases.pnpm run typecheck— clean.pnpm eslinton changed files — clean.@truefoundry/trueforgeminor — new endpoint).postgres:17-alpineservice.🤖 Generated with Claude Code
https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba
Note
Medium Risk
Introduces a destructive admin settings operation that permanently removes provider configuration (including stored API keys) and drops models from the tenant catalog; behavior is tenant-scoped and matches other idempotent delete routes.
Overview
Adds
DELETE /api/v1/settings/model-providers/{name}so admins can permanently remove a configured model provider (unblocks Settings → Models “Remove” once the SDK regenerates).The handler follows the existing settings delete pattern: tenant-scoped row delete, 200 with
{}, and idempotent when the name is already gone. Storage goes through newIModelProviderStore.deleteProvider, implemented in both Postgres and SQLite with a straightmodel_providerdelete by(tenant_id, name).OpenAPI/Fern metadata and
DeleteModelProviderResponseSchemaare added alongside contract and API tests for successful delete, list emptying, and idempotent unknown names.Reviewed by Cursor Bugbot for commit 2faf9a8. Bugbot is set up for automated code reviews on this repo. Configure here.