fix(provider): cascade delete aliases on provider removal; persist token limits for custom models - #2020
Open
hamsa0x7 wants to merge 2 commits into
Open
fix(provider): cascade delete aliases on provider removal; persist token limits for custom models#2020hamsa0x7 wants to merge 2 commits into
hamsa0x7 wants to merge 2 commits into
Conversation
…ist token limits for custom models
ozkancan-apk
added a commit
to ozkancan-apk/9routerFullFree
that referenced
this pull request
Jun 24, 2026
…it), decolua#2020 (cascade delete + token limits), decolua#2018 (dynamic model fetch) PR decolua#2046: SSE non-JSON satir + duplicate [DONE] fix. Stream kararlilik. PR decolua#2007: 5 guvenlik yamasi (API key leak, proxy URL validation, XSS, MITM race, lock file). PR decolua#2020: Provider silinince model alias cascade delete + custom model token limit. PR decolua#2018: Custom provider'dan model listesi dinamik cekme. + onceki: betterSqliteAdapter transaction fix (createProviderConnection undefined hatasi).
afandiaziz
added a commit
to afandiaziz/9router
that referenced
this pull request
Aug 22, 2026
…ken limits for custom models (decolua#2020)
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
Fix two custom provider issues: orphaned model aliases on deletion, and missing token limit persistence for custom models.
Changes
Fix #1409 — Cascade delete model aliases on provider removal
When a provider node is deleted, model aliases in the
kvtable (scope =modelAliases) that reference that provider were left orphaned. This blocked re-importing models on a recreated provider with the same prefix.Files changed:
src/app/api/provider-nodes/[id]/route.js— AddeddeleteModelAliasesByProvider(id)call before node deletionsrc/lib/db/repos/aliasRepo.js— AddeddeleteModelAliasesByProvider(providerId)function that deleteskvrows wherevalue LIKE '{providerId}/%'src/lib/db/index.js— Exported new functionsrc/models/index.js— Re-exported from models layerFix #1294 — Persist max_input_tokens / max_output_tokens for custom models
POST /api/models/customonly acceptedproviderAlias,id,type, andname, silently droppingmaxInputTokensandmaxOutputTokensfields. The DB storage also only persisted the 4 basic fields.Files changed:
src/app/api/models/custom/route.js— AcceptsmaxInputTokensandmaxOutputTokensfrom request body, passes to reposrc/lib/db/repos/aliasRepo.js—addCustomModelnow accepts and storesmaxInputTokens/maxOutputTokensin the JSON blob when providedTest Plan
Notes
{providerId}/which is the standard alias format