Files
OmniRoute/tests/unit/oauth-test-config-8408.test.ts
Praveen K Palaniswamy 65e81158ab fix(ollama): route models by advertised capability (#11088)
Landed with the design call resolved per the owner's pick — **option 1**: the synced store is now endpoint-agnostic (persistDiscoveredModels and managedModelImport no longer drop non-chat models at write time), and chat selectability moved to read time (auto-pool expansion in autoStrategy applies filterChatSelectableModels; the models-route projection already had its chatOnly filter). Your discovery test now passes end-to-end (3/3): /api/show capabilities persist per connection and image/embedding requests route through the advertising host.

Reconciliation notes: conflicted areas merged onto the current tip (adobe discovery import, requestedModel preflight signature, resolvedProvider fast-path coexists with the synced-route override — explicit resolution wins); carried base-red drains (#10055 memoization, #11071 test variants) dropped as already-landed; the managed-model-import exclusion test was propagated to the new contract (image/video models persist; the read filter still hides them from chat pickers — pinned by a new assertion). Full battery: 205/206 focused (the one red is a confirmed periodic-timer timing flake on the loaded devbox — 20/20 isolated), autoCombo vitest 30/30, combo suites 46/46, gates + typecheck clean.

Thank you @yourspraveen — the capability probe + routing design was right; it just needed the store contract opened up. Fixes #11087.
2026-08-23 11:45:01 -03:00

46 lines
2.1 KiB
TypeScript

// #8408: Guard against missing OAUTH_TEST_CONFIG entries for OAuth providers
import test from "node:test";
import assert from "node:assert/strict";
import { OAUTH_PROVIDERS } from "../../src/shared/constants/providers/oauth.ts";
import { OAUTH_TEST_CONFIG } from "../../src/app/api/providers/[id]/test/oauthTestConfig.ts";
// NOT a design decision — this is a grandfathered backlog. These four ids are simply the
// providers that still lack an OAUTH_TEST_CONFIG entry today, captured so this guard can be
// enforced from now on without a big-bang change. Each one is a candidate for the same
// treatment devin-cli and agy get here; removing an id from this list is the fix, not a
// regression. Do not add new ids to it — a provider added without a test config should fail
// this test at the time it is added, which is the entire point.
const GRANDFATHERED_WITHOUT_TEST_CONFIG = new Set(["qoder", "zed", "zed-hosted", "trae"]);
test("#8408: devin-cli and agy are present in OAUTH_TEST_CONFIG", () => {
assert.ok(
(OAUTH_TEST_CONFIG as Record<string, unknown>)["devin-cli"],
"devin-cli must have an entry in OAUTH_TEST_CONFIG"
);
assert.ok(
(OAUTH_TEST_CONFIG as Record<string, unknown>)["agy"],
"agy must have an entry in OAUTH_TEST_CONFIG"
);
});
test("devin-desktop connection test is import-only and not refreshable (#8228)", () => {
const config = (OAUTH_TEST_CONFIG as Record<string, { refreshable?: boolean }>)["devin-desktop"];
assert.ok(config, "devin-desktop must have an OAuth test config");
assert.equal(config.refreshable, false);
});
test("#8408: every OAuth provider ID has an OAUTH_TEST_CONFIG entry (or is grandfathered)", () => {
const providerIds = Object.keys(OAUTH_PROVIDERS);
const testConfigKeys = new Set(Object.keys(OAUTH_TEST_CONFIG));
for (const providerId of providerIds) {
const isCovered =
testConfigKeys.has(providerId) || GRANDFATHERED_WITHOUT_TEST_CONFIG.has(providerId);
assert.ok(
isCovered,
`OAuth provider '${providerId}' must have an entry in OAUTH_TEST_CONFIG. ` +
'Without one, Test Connection persists testStatus="error" on a healthy account (#8408).'
);
}
});