Files
OmniRoute/tests/unit/repro-9550-amazon-q-alias-resolution.test.ts
Paijo 7cfabfc5c9 perf(executors): lazy-load the executor registry — defer class imports + construction to first use (#11220) (#11421)
Validated in a combined 3-PR batch worktree off release/v3.8.51 tip (a sibling PR from the same author, #11495, was held out — a typecheck error in zai-web.ts only reproduced with this PR + #11495 boarded together, and cleared without #11495; isolated this PR alone confirmed clean on its own too, so the interaction belonged to #11495's side — see its comment).
- Golden lock: executor-map-golden.test.ts — passes byte-identical (same keys, classes, provider identities, dispatch guards)
- Focused tests part of batch's 94/94 node:test run
- typecheck:core, file-size, changelog-integrity, complexity, cognitive-complexity — all OK
- Full-repo lint: 228 pre-existing dashboard react-hooks/* findings, unrelated to this diff

Thanks for the measured, careful methodology here — the golden-lock contract plus the isolated DATA_DIR benchmarking make this an easy PR to trust despite the wide surface (72 files).
2026-08-25 18:22:46 -03:00

40 lines
1.4 KiB
TypeScript

// repro-9550-amazon-q-alias-resolution.test.ts
// Issue #9550: amazon-q provider silently falls back to OpenAI's endpoint
// because the "aq" alias is never resolved to "amazon-q".
import { describe, it } from "node:test";
import { strict as assert } from "node:assert";
import { resolveProviderAlias, parseModel } from "../../open-sse/services/model.ts";
import { getExecutor } from "../../open-sse/executors/index.ts";
describe("Issue #9550 - amazon-q alias resolution", () => {
it("resolveProviderAlias('aq') should return 'amazon-q'", () => {
const provider = resolveProviderAlias("aq");
assert.equal(
provider,
"amazon-q",
`Expected "amazon-q" but got "${provider}" — ALIAS_TO_PROVIDER_ID["aq"] is missing`
);
});
it('parseModel("aq/amazon-q") should resolve provider to "amazon-q"', () => {
const parsed = parseModel("aq/amazon-q");
assert.equal(
parsed.provider,
"amazon-q",
`parseModel("aq/amazon-q") provider should be "amazon-q" but got "${parsed.provider}"`
);
assert.equal(parsed.model, "amazon-q");
});
it('getExecutor("amazon-q") should exist and be a KiroExecutor', async () => {
const executor = await getExecutor("amazon-q");
assert.ok(executor, "getExecutor('amazon-q') should return an executor");
assert.equal(
executor.constructor.name,
"KiroExecutor",
"amazon-q executor should be a KiroExecutor"
);
});
});