Compare commits

...

6 Commits

Author SHA1 Message Date
Gregory Schier
d2a3f7a669 Simplify back to ternary now that typecast is gone
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:28:38 -07:00
Gregory Schier
356b8ea0d6 Remove unnecessary typecast for model.name
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:24:50 -07:00
Gregory Schier
f283b02cfe Remove redundant resolvedModelName call for non-empty names
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:19:42 -07:00
Gregory Schier
df089e6f00 Use resolvedModelName for conflict detection on named requests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:18:17 -07:00
Gregory Schier
0979398215 Refactor ternary to if-statement for readability
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:15:10 -07:00
Gregory Schier
85260ab49a Fix duplicate request snapshotting URL as name
When duplicating an unnamed request, the resolved name (URL fallback)
was being set as the duplicate's explicit name. Now the raw name field
is preserved, so unnamed duplicates continue to dynamically show the URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:07:35 -07:00

View File

@@ -144,9 +144,10 @@ export function duplicateModel<M extends AnyModel["model"], T extends ExtractMod
throw new Error("Failed to duplicate null model");
}
// If the model has a name, try to duplicate it with a name that doesn't conflict
let name = "name" in model ? resolvedModelName(model) : undefined;
if (name != null) {
// If the model has an explicit (non-empty) name, try to duplicate it with a name that doesn't conflict.
// When the name is empty, keep it empty so the display falls back to the URL.
let name = "name" in model ? model.name : undefined;
if (name) {
const existingModels = listModels(model.model);
for (let i = 0; i < 100; i++) {
const hasConflict = existingModels.some((m) => {