Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: switching to Sol works before the first model list arrives

ogsamrat5fdbe1527484
diff --git a/apps/server/src/__fixtures__/omnirush-model-catalog.json b/apps/server/src/__fixtures__/omnirush-model-catalog.json
index e333391f..584d48a8 100644
--- a/apps/server/src/__fixtures__/omnirush-model-catalog.json
+++ b/apps/server/src/__fixtures__/omnirush-model-catalog.json
@@ -28,7 +28,8 @@
"web_search": true,
"image_input": true,
"file_input": true
- }
+ },
+ "switch_group": "openai"
},
{
"id": "gpt-6.1-sol",
@@ -57,7 +58,8 @@
"web_search": true,
"image_input": true,
"file_input": true
- }
+ },
+ "switch_group": "openai"
},
{
"id": "gpt-6-sol",
@@ -86,7 +88,8 @@
"web_search": true,
"image_input": true,
"file_input": true
- }
+ },
+ "switch_group": "openai"
},
{
"id": "meta-muse-spark",
diff --git a/apps/server/src/omnirush-model-catalog.test.ts b/apps/server/src/omnirush-model-catalog.test.ts
index ecd205fc..bb9c7640 100644
--- a/apps/server/src/omnirush-model-catalog.test.ts
+++ b/apps/server/src/omnirush-model-catalog.test.ts
@@ -110,7 +110,7 @@ describe("omnirush model catalog sanitizer", () => {
const allowed = new Set([
"id", "display_name", "family", "status", "default", "reasoning_levels", "limits", "limits.context", "limits.output",
"capabilities", "capabilities.reasoning", "capabilities.tool_call", "capabilities.web_search",
- "capabilities.image_input", "capabilities.file_input",
+ "capabilities.image_input", "capabilities.file_input", "switch_group",
]);
const paths = keyPaths(catalog).map((path) => path.replace(/^\d+\./, "")).filter((path) => !/^\d+$/.test(path));
expect(paths.filter((path) => !allowed.has(path) && !/^reasoning_levels\.\d+$/.test(path))).toEqual([]);
@@ -164,7 +164,12 @@ describe("omnirush model catalog sanitizer", () => {
{ id: "gpt-6-sol", display_name: "GPT 6 Sol", default: false, reasoning_levels: ["low", "high", "xhigh", "max"] },
],
});
- expect(catalog).toEqual(builtinOmniRushModelCatalog());
+ // The shared metadata; an older backend names no switch group (only the built-ins carry the Codex route's).
+ expect(catalog).toEqual(builtinOmniRushModelCatalog().map(({ switch_group: _group, ...model }) => model));
+ });
+
+ test("before the first sync, a chat on Astra may switch to either Sol: the built-ins are one provider", () => {
+ expect(builtinOmniRushModelCatalog().map((model) => model.switch_group)).toEqual(["openai", "openai", "openai"]);
});
test("the built-ins are only the fallback (the backend's list); the catalog decides what is served", () => {
diff --git a/apps/server/src/omnirush-model-catalog.ts b/apps/server/src/omnirush-model-catalog.ts
index 7f8f4af9..2ee970d8 100644
--- a/apps/server/src/omnirush-model-catalog.ts
+++ b/apps/server/src/omnirush-model-catalog.ts
@@ -95,10 +95,12 @@ function catalogModel(
* metadata. Only a fallback: the synced catalog replaces it whole.
*/
export function builtinOmniRushModelCatalog(): OmniRushModelCatalog {
+ // One provider (the server's switch_group "openai", its Codex route): a chat switches between them before the
+ // first catalog sync too, as it does after (a fresh install used to offer a new chat instead).
return [
- catalogModel("gpt-6-astra", "GPT 6 Astra", PROVIDER_FAMILY, true),
- catalogModel("gpt-6.1-sol", "GPT 6.1 Sol", PROVIDER_FAMILY, false),
- catalogModel("gpt-6-sol", "GPT 6 Sol", PROVIDER_FAMILY, false),
+ { ...catalogModel("gpt-6-astra", "GPT 6 Astra", PROVIDER_FAMILY, true), switch_group: "openai" },
+ { ...catalogModel("gpt-6.1-sol", "GPT 6.1 Sol", PROVIDER_FAMILY, false), switch_group: "openai" },
+ { ...catalogModel("gpt-6-sol", "GPT 6 Sol", PROVIDER_FAMILY, false), switch_group: "openai" },
];
}