From f338363cd3b0a1ec3548bc7d3df53728908cfac2 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Thu, 6 Aug 2026 22:55:27 -0300 Subject: [PATCH] fix(model): add aq alias for amazon-q provider so parseModel resolves it instead of falling back to OpenAI (#9550) Closes #9550 --- changelog.d/fixes/9550-amazon-q-alias.md | 1 + open-sse/services/model.ts | 4 ++ ...pro-9550-amazon-q-alias-resolution.test.ts | 39 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 changelog.d/fixes/9550-amazon-q-alias.md create mode 100644 tests/unit/repro-9550-amazon-q-alias-resolution.test.ts diff --git a/changelog.d/fixes/9550-amazon-q-alias.md b/changelog.d/fixes/9550-amazon-q-alias.md new file mode 100644 index 0000000000..b984b8bfc0 --- /dev/null +++ b/changelog.d/fixes/9550-amazon-q-alias.md @@ -0,0 +1 @@ +- fix(model): add "aq" alias for amazon-q provider so parseModel resolves it instead of falling back to OpenAI (#9550) diff --git a/open-sse/services/model.ts b/open-sse/services/model.ts index 640fb10802..9465529a27 100644 --- a/open-sse/services/model.ts +++ b/open-sse/services/model.ts @@ -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/") +// 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. diff --git a/tests/unit/repro-9550-amazon-q-alias-resolution.test.ts b/tests/unit/repro-9550-amazon-q-alias-resolution.test.ts new file mode 100644 index 0000000000..7f31ef4b83 --- /dev/null +++ b/tests/unit/repro-9550-amazon-q-alias-resolution.test.ts @@ -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" + ); + }); +});