Skip to content

CASOL-2: Move combo capabilities to shared module + add branch tests#2156

Open
alt-coder wants to merge 5 commits into
decolua:masterfrom
alt-coder:20260627-132240-casol-2-pr
Open

CASOL-2: Move combo capabilities to shared module + add branch tests#2156
alt-coder wants to merge 5 commits into
decolua:masterfrom
alt-coder:20260627-132240-casol-2-pr

Conversation

@alt-coder

@alt-coder alt-coder commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Move aggregateCapabilities and getComboCapabilities from src/app/api/v1/models/route.js to open-sse/providers/capabilities.js so unit tests can import the real implementation instead of re-implementing aggregation logic.

Changes

  • open-sse/providers/capabilities.js — new exports: aggregateCapabilities, getComboCapabilities
  • src/app/api/v1/models/route.js — drop local copies, import from shared module
  • tests/unit/combo-capabilities.test.js — import real functions, add missing test branches (thinkingFormat, thinkingRange, empty/non-array input, non-finite numeric filtering, slashless model strings, whitespace filtering)

Test Results

$ npx vitest run tests/unit/combo-capabilities.test.js
 → 15/15 pass

$ npx vitest run tests/unit/capabilities.test.js tests/unit/capabilities-opus-context.test.js tests/unit/capabilities-service-kind.test.js
 → 9/9 pass (no regression)

Evidence

Artifact Status
QAS Approval agent-qas.md — Approved
Implementor commit a753e09
Unit tests 15/15 pass (11 new assertions)
Source syntax check node --check passed (3 files)
Pre-existing regressions 2 failures in combo-autoswitch.test.js (same failures on baseline — pre-existing, unrelated)
CI No PR CI workflow configured in repo (only tag-push Docker build + GitBook deploy)

Closes

Closes CASOL-2

ram and others added 5 commits June 26, 2026 19:06
…ichment

- next.config.mjs: NINEROUTER_BASE_PATH -> Next basePath
- dashboardGuard.js: redirectWithBasePath preserves sub-path on redirects
- models/route.js + info/route.js: Litellm-compatible model_info, dbUnavailable flag, upstream capability cache
- lib/upstreamModelMetadata.js: fetch/parse/cache upstream model metadata

Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts:
#	src/app/api/v1/models/route.js
scripts/deploy.sh: build (NINEROUTER_BASE_PATH), refresh 9router-deploy
from .next/standalone + loose open-sse + custom-server.js + the
easily-forgotten .next/static assets, then restart the systemd user
service. Includes readiness poll + retrying smoke test. DB at
9router-data untouched.

Force-added past .gitignore deploy*.sh rule (server-specific, not for upstream).

Co-Authored-By: Claude <noreply@anthropic.com>
- Move getComboCapabilities / aggregateCapabilities from route.js to
  open-sse/providers/capabilities.js so tests can import the real impl.
- Drop the inline copy in combo-capabilities.test.js; import the real
  functions instead. This fixes the false-confidence test gap flagged
  by all three critics.
- Add test cases for thinkingFormat unanimity/divergence, thinkingRange
  conservative bounds, single-element input, empty/non-array input,
  non-finite numeric filtering, slashless model strings, whitespace
  filtering, and round-trip with getCapabilitiesForModel.
- Replace Math.min(...vals) / Math.max(...vals) with reduce() so
  massive combo lists cannot blow the argument-stack limit (latent
  footgun flagged by critic1, masked by current small combos).
- Reformat thinkingFormat / thinkingRange branches to explicitly assign
  null on failure instead of relying on the spread of DEFAULT
  (preserves same observable contract, clearer intent).

Refs CASOL-2.
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