Skip to content

fix: skip non-chat generation models in Test all models - #13409

Merged
diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.51from
KooshaPari:pr/13376-model-test-modality-guard
Sep 15, 2026
Merged

diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.51from
KooshaPari:pr/13376-model-test-modality-guard

Conversation

@KooshaPari

Copy link
Copy Markdown
Contributor

Summary

Adds a modality guard to detectTestKind() so that "Test all models" no longer dispatches chat-completions to image/music/video-only generation models.

Problem

When "Test all models" iterated over every model in the registry, it would send a chat-completion probe to models like DALL-E 3 (image-only), Suno (music-only), or Runway (video-only). These models do not accept chat messages. The upstream API either returns a 400 or silently runs a real generation, incurring billable credits the operator never asked for.

Changes

  • modelTestKind type gains isNonChatGeneration: boolean
  • detectTestKind() flags isNonChatGeneration = true when supportedEndpoints contains only generation-only types (images, music, videos) with no chat endpoint
  • runSingleModelTest() returns an early { success: true, skipped: true } result with a descriptive error when isNonChatGeneration is true
  • Updated 4 existing deep-equal assertions to include the new field
  • Added 8 regression tests covering all modality combinations

Test results

tests 34 / pass 34 / fail 0

Fixes #13376

The 'does not duplicate custom Jina specialty models' test asserted
catalog IDs prefixed with 'jina-ai/' (the connection/provider ID), but
the catalog builder uses the provider alias 'jina' — which was
introduced in v3.8.36. The test above it in the same file ('does not
duplicate imported Jina specialty models') already asserts 'jina/' and
passes; this second test was simply never updated.

Fix the two assert.equal strings from 'jina-ai/' to 'jina/' to match
the current product behavior.

Fixes diegosouzapw#13313 (Jina portion — pt-BR compression integration tests need
separate investigation)
…iegosouzapw#13308)

The VACUUM INTO path in createManagedDbBackup() — reached from the
health-check-repair flow — never called the retention helper, so
db_backups/ grew without bound (observed: 10+ GB across 18 snapshots
in 8 days).

The sibling path (backupDbFile → backup.ts) already calls
cleanupDbBackups() after each snapshot; the health-check path simply
forgot to do the same.

Fix: after a successful VACUUM INTO in createManagedDbBackup(), call
pruneBackupDirectory() from backupRetention.ts using the same
env-var precedence (DB_BACKUP_MAX_FILES / DB_BACKUP_RETENTION_DAYS)
as the manual/scheduled backup path. Pruning is wrapped in a try/catch
so a best-effort failure never obscures the backup result.

Regression test: db-backup-healthcheck-prune-13308.test.ts seeds a
backup directory with MAX_DB_BACKUPS + 5 families and asserts that
pruneBackupDirectory removes exactly the overflow.
…pw#13376)

detectTestKind now returns isNonChatGeneration when a custom model's
supportedEndpoints contain only generation-only types (images, music,
videos) with no chat endpoint. runSingleModelTest returns an early
'disabled' result instead of dispatching a chat completion to a model
that cannot handle it.

- Added isNonChatGeneration flag to TestKind detection
- Updated 4 existing deepEqual assertions to include the new field
- Added 8 regression tests covering all modality combinations

Fixes diegosouzapw#13376
Copilot AI lite review requested due to automatic review settings September 12, 2026 06:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@diegosouzapw
diegosouzapw merged commit 2a6d058 into diegosouzapw:release/v3.8.51 Sep 15, 2026
7 of 16 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…#13409)

"Test all models" no longer sends image/music/video generation-only models through a chat completion, which triggered real billable generations (diegosouzapw#13376). `detectTestKind` flags them via `isNonChatGeneration` and `runSingleModelTest` skips them; chat+image models, embeddings and models without metadata are unaffected (8 new cases plus updated `model-test-runner` shapes).

Validated in one consolidated batch of this series (37 PRs boarded together on `release/v3.8.51`): `typecheck:core`, `check:open-sse-typecheck` and `check:dashboard-typecheck` clean; ESLint clean on every changed file; file-size, complexity, cognitive-complexity, changelog-integrity, docs-counts, docs-sync and migration-numbering gates green (only the pre-existing `open-sse/utils/stream.ts` file-size red remains, inherited from the base); 3,743 focused `node:test` cases plus 34 vitest cases green.

Thanks @KooshaPari!
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.

fix(dashboard): "Test all models" has no modality/cost guard — image and music models are billed as real generations

3 participants