mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 14:52:09 +03:00
fix(image): keep bare gpt-5.5 codex mapping in image resolver (#5902)
* fix: preserve codex bare image model over combo shadowing * docs(changelog): credit #5902 codex bare image alias fix * docs(changelog): restore #5902 bullet after merge auto-resolve --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
---
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user