Skip to content

fix(catalog): scope combo reasoning efforts by connection - #10723

Merged
diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.50from
xz-dev:fix/combo-connection-reasoning-efforts
Aug 20, 2026
Merged

diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.50from
xz-dev:fix/combo-connection-reasoning-efforts

Conversation

@xz-dev

@xz-dev xz-dev commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve Grok Build's exact discovered low / medium / high reasoning-effort vocabulary from one shared runtime source of truth.
  • Derive combo effort_tiers from the exact runtime-selectable connection scope: dynamic accounts, pinned connectionId, allowedConnectionIds, built-in aliases, and compatible provider-node public prefixes.
  • Intersect every selectable connection's exact tiers and fail closed for stale scopes, missing models/tiers, malformed persisted catalogs, query failures, and unknown multi-target metadata. Static fallback is limited to explicitly declared supportedThinkingEfforts; model names and generic reasoning heuristics never synthesize combo tiers.

Related Issues

Validation

Choose the change type and focused loop from the
Contribution Golden Path. The full unit suite,
Vitest, the 60% coverage gate, and the production build all run in CI on this PR (#8329):

  • Change type: provider / routing
  • Focused tests and category gates from the golden path
    • node --import tsx --test tests/unit/catalog-helpers-extraction.test.ts tests/unit/models-catalog-combo-metadata.test.ts tests/unit/provider-models-discovery-split.test.ts tests/unit/grok-cli-responses-compat.test.ts
    • Post-commit result: 59/59 passed
    • Extended catalog/prefix/token regression run: 74/74 passed
    • npm run typecheck:core
    • npm run typecheck:noimplicit:core
    • npm run check:dashboard-typecheck
    • npm run i18n:check-ui-coverage
    • npm run i18n:check-value-drift
    • npm run check:changelog-integrity
    • Changed-file ESLint and git diff --check
    • Commit hooks: Prettier, changed-file ESLint, docs sync, explicit-any budget, tracked-artifacts
  • npm run lint
    • The changed files pass ESLint. The repo-wide command is blocked only by 25 pre-existing @typescript-eslint/no-explicit-any errors in tests/unit/cli-oauth-commands.test.ts and tests/unit/executor-gitlab.test.ts.
  • Reconciled with the current active release base; focused checks rerun afterward
    • HTTPS fetch confirmed origin/release/v3.8.50@b754e44e260ba888035b8ec077b4da8ea4483e48; this branch is one commit directly on that base.
  • Production-code changes include a new or updated automated test in this PR
  • SonarQube is temporarily opt-in while the private project has no quota; it is not a PR gate.

Additional baseline note: npm run check:open-sse-typecheck reports open-sse/executors/index.ts(239,27) TS2345 for the pre-existing GlmExecutor.buildHeaders signature mismatch. The exact diagnostic reproduces in a detached clean worktree at origin/release/v3.8.50; this PR does not modify that path.

Tests Added Or Updated

  • tests/unit/catalog-helpers-extraction.test.ts
  • tests/unit/grok-cli-responses-compat.test.ts
  • tests/unit/models-catalog-combo-metadata.test.ts
  • tests/unit/provider-models-discovery-split.test.ts

Coverage Notes

  • Grok discovery tests cover camel/snake-case effort metadata, exact filtering, default capability behavior, and unsupported explicit lists.
  • Pure helper tests cover dynamic, pinned, allowlisted, stale, missing-model, missing-tier, and no-eligible connection scopes.
  • Real SQLite + /v1/models regressions cover dynamic intersection, pinned and allowlisted scopes, malformed persisted catalogs, compatible provider-node prefixes, and unknown multi-target fail-closed behavior.

Reviewer Notes

  • No migration or feature flag.
  • Connection catalogs are bulk-loaded once per distinct combo provider; no per-target SQLite query was added.
  • Two read-only reviewer passes found no blocking issues. Follow-up review confirmed malformed-row and provider-prefix residuals were closed.

@xz-dev
xz-dev requested a review from diegosouzapw as a code owner August 19, 2026 06:58
@xz-dev

xz-dev commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

CI baseline verification

I investigated every red check from this PR against the exact base commit, b754e44e260ba888035b8ec077b4da8ea4483e48. No failing check points to a file changed by this PR.

  • Vitest (fast-path): both fix(catalog): scope combo reasoning efforts by connection #10723 and feat(settings): add reasoning effort model overrides #10724 fail the same single test, tests/unit/autoCombo/provider-family-combos.test.ts:147, because the base now returns the additional cloudflare-playground provider. In a clean detached worktree at the exact base SHA, npm run test:vitest -- tests/unit/autoCombo/provider-family-combos.test.ts reproduces the identical diff: 1 failed, 10 passed.
  • Unit Tests fast-path (1/4 through 4/4): the two independent PRs report the same unrelated failure families (SSE metadata/passthrough, Antigravity/GLM registry expectations, heartbeat timers, i18n glossary/parity, OpenRouter catalog warmup, and model sync). The upstream Nightly Node Compat run for the exact base SHA independently fails all four Node 24 shards and all four Node 26 shards with the same signatures. For example, its Node 24 shard 1 reproduces the SSE failures and shard 4 reproduces both model-sync failures.
  • No new ESLint warnings: clean-base npm run lint:json -- --max-warnings 0 exits 1 with exactly 25 errors and zero warnings: 20 @typescript-eslint/no-explicit-any errors in tests/unit/cli-oauth-commands.test.ts and 5 in tests/unit/executor-gitlab.test.ts. Neither file is changed here.
  • Fast Quality Gates: clean-base runs reproduce check:error-helper (open-sse/handlers/imageGeneration/providers/geminiWeb.ts), check:mutation-test-coverage (four missing Stryker test entries), and check:open-sse-typecheck (open-sse/executors/index.ts TS2345). With the release lockfile's Knip 6.32.2, clean-base npm run check:dead-code also reproduces DEAD_TOTAL=419 against baseline 415, exactly matching this PR. The earlier focused typecheck:core, dashboard typecheck, i18n, changelog, changed-file ESLint, focused tests, build, docs, merge-integrity, DAST, and Semgrep results remain green.

The base/head relationship remains one commit directly on release/v3.8.50; this is a release-baseline CI break, not a regression introduced by this PR.

hartmark and others added 2 commits August 19, 2026 21:12
Port the reasoning_efforts model-capability override from cheaper-inference#10724 into this
branch, reconciled with the connection-scoped effort-tiers fail-closed
guarantee already in place here. A `reasoning_efforts` override is now
authoritative provider-scoped evidence for combo effort_tiers resolution
-- it is applied before (and is never silently dropped by) the
per-connection synced-catalog fail-closed scan, and the existing
skipCanonicalEffortFallback: true fail-closed behavior is preserved
unchanged for models without an override.

Also fixes a dead branch in parseReasoningEffortsOverride: `.split(",")`
on an ASCII string never returns an empty array, so the
`segments.length === 0` guard could never fire; the existing per-item
empty-check already covers "" and trailing commas correctly.

Co-authored-by: Xiangzhe <32761048+xz-dev@users.noreply.github.com>
Resolves the base-drift documented in _tasks/pipeline/prs/1-analyzed/10723-*.plan.md
(cheaper-inference#9147 catalog cooperative-yield + a released signature change on
getCanonicalModelMetadata's snapshot parameter — kept the release's
object-bundled-snapshot signature, adapted the two call sites this PR touched).
@diegosouzapw
diegosouzapw merged commit 9fc3b29 into cheaper-inference:release/v3.8.50 Aug 20, 2026
6 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ference#10723)

Merged — locally validated (72/72 focused tests, typecheck:core clean, all static gates green) after resolving base-drift conflicts (catalog.ts cooperative-yield insertion point, modelMetadataRegistry.ts snapshot-param signature). CI's red checks (Unit Tests fast-path shards, Fast Quality Gates, Docs Gates) are confirmed PRE-EXISTING base-red on the pure release tip — reproduced tests/unit/db-driver-bundling-externals.test.ts, tests/unit/model-catalog-runtime-invalidation.test.ts and others failing identically against origin/release/v3.8.50 with zero PR content, unrelated to this change. Thanks for the design and for absorbing cheaper-inference#10724's value here — great work on both review rounds!
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.

3 participants