Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit e179286

Browse files
authored
fix(agent): Put most capable Claude at top (#3658)
1 parent 9ca0258 commit e179286

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

packages/agent/src/adapters/claude/session/model-config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe("applyAvailableModelsAllowlist", () => {
2626
"claude-opus-4-8",
2727
]).options,
2828
).toEqual([
29-
{ value: "claude-opus-4-8", name: "Claude Opus 4.8" },
3029
{ value: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
30+
{ value: "claude-opus-4-8", name: "Claude Opus 4.8" },
3131
]);
3232
});
3333

packages/agent/src/gateway-models.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ describe("getClaudeModelRecency", () => {
132132
});
133133

134134
describe("compareModelsForPicker", () => {
135-
it("groups models by family, most capable first, newest version first", () => {
135+
it("groups models by family least capable first, newest version first", () => {
136+
// The picker opens upward, so least-capable-first DOM order puts the most
137+
// capable family (Fable) nearest the trigger — the visual top of the menu.
136138
// Models as the gateway might return them — arbitrary order.
137139
const gatewayOrder = [
138140
"claude-fable-5",
@@ -145,12 +147,12 @@ describe("compareModelsForPicker", () => {
145147
];
146148
const displayed = [...gatewayOrder].sort(compareModelsForPicker);
147149
expect(displayed).toEqual([
148-
"claude-fable-5",
149-
"claude-opus-4-8",
150-
"claude-opus-4-7",
150+
"claude-haiku-4-5",
151151
"claude-sonnet-5",
152152
"claude-sonnet-4-6",
153-
"claude-haiku-4-5",
153+
"claude-opus-4-8",
154+
"claude-opus-4-7",
155+
"claude-fable-5",
154156
"claude-mystery",
155157
]);
156158
});

packages/agent/src/gateway-models.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ export function getClaudeModelRecency(modelId: string): number {
279279
return major * 1000 + minor;
280280
}
281281

282-
// Families ordered most-capable first; unknown families sort last.
283-
const MODEL_FAMILY_ORDER = ["fable", "opus", "sonnet", "haiku"];
282+
// Families ordered least-capable first. The picker opens upward (side="top")
283+
// from the composer, so items later in this list render nearer the trigger and
284+
// read as the top of the menu — this puts the most-capable family (Fable) on
285+
// top. Unknown families sort after all known ones.
286+
const MODEL_FAMILY_ORDER = ["haiku", "sonnet", "opus", "fable"];
284287

285288
function getModelFamilyRank(modelId: string): number {
286289
const id = modelId.toLowerCase();

0 commit comments

Comments
 (0)