Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

- **fix(usage):** preserve (bounded) tool definitions in request logs even when the request body is truncated, so the request-details view can still show available tools. (thanks @noir017)

- **fix(image):** keep bare codex image aliases (e.g. `gpt-5.5`) resolving to the codex image pipeline even when a combo shares the same name. A chat combo named `gpt-5.5` used to shadow the bare image alias in `resolveImageRouteModel`, hijacking `/v1/images/*` requests to a chat target (regression path adjacent to [#5887](https://github.com/diegosouzapw/OmniRoute/issues/5887)); codex bare models are now reserved before bare-combo resolution, while non-codex aliases (e.g. `gpt-image-2`) remain user-shadowable (#3214/#3215 behavior preserved). Regression guard: `tests/unit/image-routes-combo-edits-3214-3215.test.ts` (9). ([#5902](https://github.com/diegosouzapw/OmniRoute/pull/5902) by [@KooshaPari](https://github.com/KooshaPari))

- **fix(ci):** re-green the `release/v3.8.43` fast-gates queue — every PR→release was inheriting base-reds ([#5798](https://github.com/diegosouzapw/OmniRoute/issues/5798)). Five distinct blockers cleared: (1) stale `modelContextOverrides` entry in the `check:db-rules` intentionally-internal allowlist ([#5827](https://github.com/diegosouzapw/OmniRoute/pull/5827) allowlisted it while the [#5609](https://github.com/diegosouzapw/OmniRoute/issues/5609) fix re-exported it from `localDb.ts`; the re-export stays, the obsolete entry goes, classification guard re-pinned to 33); (2) `LIVE_WS_ALLOWED_HOSTS` / `NEXT_PUBLIC_LIVE_WS_PUBLIC_URL` documented in `docs/reference/ENVIRONMENT.md` (env/docs contract, from [#5877](https://github.com/diegosouzapw/OmniRoute/pull/5877)); (3) the Router Backends ADR's references to the not-yet-merged registry ([#5868](https://github.com/diegosouzapw/OmniRoute/pull/5868)) marked as landing-with-PR so `check:fabricated-docs --strict` passes; (4) `antigravity-429-quota-tdd` + `middleware-header-strip-5849` added to stryker `tap.testFiles` (`check:mutation-test-coverage`); (5) file-size / complexity / cognitive-complexity ratchets rebaselined with justification notes — all drift measured identical on the pristine tip and this PR (net-zero). Regression guard: `tests/unit/check-db-rules-classification.test.ts`. ([#5798](https://github.com/diegosouzapw/OmniRoute/issues/5798))

---
Expand Down
15 changes: 9 additions & 6 deletions src/lib/images/imageRouteModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,21 @@ export async function resolveSingleImageComboTarget(name: string): Promise<strin
*/
export async function resolveImageRouteModel(modelStr: string): Promise<string> {
if (typeof modelStr !== "string" || !modelStr.trim()) return modelStr;
const parsedModel = parseImageModel(modelStr);
const hasSlash = modelStr.includes("/");

// 1. Bare model name: resolve to its single combo target when safe.
// Codex bare models are reserved to avoid shadowing `gpt-5.5`-style aliases used
// across image + responses flows.
if (!hasSlash) {
if (parsedModel.provider === "codex") return modelStr;

// 1. Bare combo/alias name (no slash): resolve to its single image target, then
// prefix-resolve that target (it may itself be a `prefix/model` custom id).
// This intentionally precedes built-in aliases so user combos can shadow names
// like `gpt-image-2`; explicit `provider/model` ids still bypass this branch.
if (!modelStr.includes("/")) {
const target = await resolveSingleImageComboTarget(modelStr);
if (target && target !== modelStr) return resolveImageModelPrefix(target);
}

// 2. Built-in image model (alias or provider/model) — leave untouched.
if (parseImageModel(modelStr).provider) return modelStr;
if (parsedModel.provider) return modelStr;

if (!modelStr.includes("/")) return modelStr;

Expand Down
7 changes: 7 additions & 0 deletions tests/unit/image-routes-combo-edits-3214-3215.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ test("resolveImageRouteModel lets bare combos shadow built-in image aliases", as
assert.equal(await resolveImageRouteModel("openai/gpt-image-2"), "openai/gpt-image-2");
});

test("resolveImageRouteModel keeps codex bare aliases over same-name combos", async () => {
await createCombo({ name: "gpt-5.5", models: ["myimg/gpt-5.5"], strategy: "priority" });

assert.equal(await resolveSingleImageComboTarget("gpt-5.5"), "myimg/gpt-5.5");
assert.equal(await resolveImageRouteModel("gpt-5.5"), "gpt-5.5");
});

test("resolveImageRouteModel leaves built-in / already-resolved ids untouched", async () => {
assert.equal(
await resolveImageRouteModel("cgpt-web/gpt-5.3-instant"),
Expand Down
Loading