mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-08 00:02:20 +03:00
fix(model): add aq alias for amazon-q provider so parseModel resolves it instead of falling back to OpenAI (#9550)
Closes #9550
This commit is contained in:
committed by
GitHub
parent
28dc5af7ba
commit
f338363cd3
1
changelog.d/fixes/9550-amazon-q-alias.md
Normal file
1
changelog.d/fixes/9550-amazon-q-alias.md
Normal file
@@ -0,0 +1 @@
|
||||
- fix(model): add "aq" alias for amazon-q provider so parseModel resolves it instead of falling back to OpenAI (#9550)
|
||||
@@ -54,6 +54,10 @@ ALIAS_TO_PROVIDER_ID["xiaomi"] = "xiaomi-mimo";
|
||||
ALIAS_TO_PROVIDER_ID["llamacpp"] = "llama-cpp";
|
||||
// agy/ is the short alias for antigravity provider.
|
||||
ALIAS_TO_PROVIDER_ID["agy"] = "antigravity";
|
||||
// aq/ is the user-visible prefix for the Amazon Q (AWS Builder ID) provider.
|
||||
// The canonical provider ID is "amazon-q". Register it so parseModel("aq/<model>")
|
||||
// resolves provider = "amazon-q" instead of falling through to the identity fallback.
|
||||
ALIAS_TO_PROVIDER_ID["aq"] = "amazon-q";
|
||||
|
||||
// Provider-scoped legacy model aliases. Used to normalize provider/model inputs
|
||||
// and keep backward compatibility when upstream IDs change.
|
||||
|
||||
39
tests/unit/repro-9550-amazon-q-alias-resolution.test.ts
Normal file
39
tests/unit/repro-9550-amazon-q-alias-resolution.test.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
// 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', () => {
|
||||
const executor = 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"
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user