Skip to content

fix(combo): drop malformed custom models from the auto candidate pool - #16069

Merged
diegosouzapw merged 1 commit into
release/v3.8.52from
fix/combo-sanitize-custom-auto-models-v3852
Oct 9, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.52from
fix/combo-sanitize-custom-auto-models-v3852

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Re-cut of #15803 onto the active cycle (v3.8.51 is shipped).

What

customModels is an operator-writable key_value JSON blob. expandAutoComboCandidatePool now drops rows that are not objects with a non-empty string id (and a string[] supportedEndpoints when one is present) before the chat endpoint policy runs. Before this, a malformed row (null, a bare string, { name } without an id) could abort the expansion or make the provider fall back to its static catalogue instead of the operator's visible custom chat model.

Carried / dropped vs #15803

  • Carried: the sanitize half: isValidAutoCustomModel / sanitizeAutoCustomModels in open-sse/services/combo/autoStrategy.ts, plus its regression test in tests/unit/combo-auto-candidate-expansion.test.ts.
  • Dropped: the typing half. It is already on release/v3.8.52 via fix(combo): type the custom-model row in the auto pool check #15461.
  • Small difference: the helpers sit above the expandAutoComboCandidatePool JSDoc, not between the JSDoc and the function, so the docblock stays attached to the function.

Test evidence

  • node --import tsx/esm --test tests/unit/combo-auto-candidate-expansion.test.ts
    • with the v3.8.52 tip autoStrategy.ts: 9/10, 1 failed: ignores malformed custom rows while keeping chat models → AssertionError: only the well-formed visible custom chat model should be expanded
    • with the change (after rebasing onto f90e64a): 10/10 pass
  • prettier --check, eslint --suppressions-location config/quality/eslint-suppressions.json on the changed files, npm run typecheck:core, npm run check:open-sse-typecheck (0 errors) and npm run typecheck:noimplicit:core (0 errors in autoStrategy.ts) → clean.

customModels is an operator-writable key_value JSON blob. Filter out rows
that are not objects with a non-empty string id (and a string[]
supportedEndpoints when present) before the endpoint policy runs, so a
malformed row cannot abort the auto-combo expansion or push it back to
the static catalogue.
@diegosouzapw
diegosouzapw merged commit 977d006 into release/v3.8.52 Oct 9, 2026
24 of 46 checks passed
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

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