Repository navigation
feat(combos): opt-in auto-prune of stale combo steps after a model sync - #15925
Merged
diegosouzapw merged 5 commits intoOct 10, 2026
Conversation
Opt-in runtime flag, default false, for removing the stale combo steps a model sync flags. Documented in the feature flag catalog; the flag count pins move from 84 to 85.
…abled With COMBO_AUTO_PRUNE_STALE_STEPS on, a successful sync removes the steps findStaleComboModelRefs flagged and writes one combo.stale_model_ref.pruned audit entry per removed step. The response adds prunedComboRefs, and staleComboRefs keeps only what is still flagged. Failed and degraded syncs return before the check, a provider without an authoritative catalog flags nothing, and a free-only import never prunes because its catalog is a deliberate subset. A combo is never emptied: if every step is stale it stays as is and stays flagged. With the flag off the sync only flags, as before.
Open
3 tasks
The feature-flag page matches the hash of the text this PR adds. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw
merged commit Oct 10, 2026
b65b298
into
cheaper-inference:release/v3.8.52
19 of 41 checks passed
Collaborator
|
Thanks @tiagovilasboas — this is in the upcoming release. |
Closed
7 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
COMBO_AUTO_PRUNE_STALE_STEPS(runtime, boolean, defaultfalse).findStaleComboModelRefsflagged are removed from their combos. Each removed step writes onecombo.stale_model_ref.prunedaudit entry, with the combo as target and{ connectionId, provider, comboId, comboName, stepId, model }as details. The sync response addsprunedComboRefs, andstaleComboRefskeeps only what is still flagged.importFreeModelsOnly/freeFilterEmpty), because that catalog is a deliberate subset and doesn't reflect what the provider actually serves.Related Issues
Validation
tests/unit/combo-stale-auto-prune-13505.test.ts(4/4), plus the impacted set from the test-impact map and every feature-flag test: 42 files, 267/267npm run lintscope: eslint + prettier clean on all touched files.check-api-typecheckOK (within the frozen baseline), and no new type errors in the touched filescheck-env-doc-sync,check-fabricated-docs,check-docs-syncandfeature-flags-doc-sync-staticpassrelease/v3.8.52@f9989a14)Tests Added Or Updated
tests/unit/combo-stale-auto-prune-13505.test.ts(new). It uses the real route, DB and audit log, with a mocked upstream:prunedComboRefsis empty, combos are unchanged and there is no prune audit entry;staleComboRefs;local_catalog) sync: nothing is removed and nothing is audited.tests/unit/feature-flags-settings.test.ts,tests/unit/server-owned-tool-loop-flag.test.ts: flag count pins 84 to 85.Coverage Notes
src/lib/combos/staleModelPrune.ts(new) and the sync route hook are covered by the new test file end to end.test:scoped:featureFlagDefinitions.tsmaps to about 4.2k test files and the newstaleModelPrune.tsis unmapped (__RUN_ALL__). Locally I ran the impacted set for the other changed files plus all*flag*unit tests (42 files). The full suite runs in CI.Reviewer Notes
OMNIROUTE_AUTO_SYNC_CODEX_PROFILES/..._CLAUDE_PROFILES). It shows up on the existing Feature Flags page, toggles without a restart, and can be set from env. So there is no new settings UI.featureFlags.definitions.<KEY>when it exists and otherwise falls back to the English definition text, as it does for about 39 other flags. The rootfeatureFlag*Descriptionkeys are not rendered by the dashboard (see the note infeature-flag-descriptions-claims.test.ts), so adding one would only add untranslated weight to 66 locale files.isExplicitModelStepand updates thestaleModelRefs.tsheader comment). Either can merge first.