fix(dashboard): surface model-write failure when creating a profile
POST /api/profiles returns model_set: false when the model assignment step fails (e.g. filesystem error) while the profile itself was created successfully. handleCreate discarded the response, so the user received a "Profile created" success toast with no indication that their chosen model was not persisted. Capture the response and show an error toast when a model was selected but model_set is explicitly false, directing the user to set it from the profile editor.
This commit is contained in:
parent
6feb40e702
commit
c2d11cc95d
@ -414,7 +414,7 @@ export default function ProfilesPage() {
|
|||||||
(c) => `${c.provider}\u0000${c.model}` === modelChoice,
|
(c) => `${c.provider}\u0000${c.model}` === modelChoice,
|
||||||
)
|
)
|
||||||
: undefined;
|
: undefined;
|
||||||
await api.createProfile({
|
const res = await api.createProfile({
|
||||||
name,
|
name,
|
||||||
clone_from_default: cloneAll ? false : cloneFromDefault,
|
clone_from_default: cloneAll ? false : cloneFromDefault,
|
||||||
clone_all: cloneAll,
|
clone_all: cloneAll,
|
||||||
@ -424,6 +424,12 @@ export default function ProfilesPage() {
|
|||||||
model: picked?.model,
|
model: picked?.model,
|
||||||
});
|
});
|
||||||
showToast(`${t.profiles.created}: ${name}`, "success");
|
showToast(`${t.profiles.created}: ${name}`, "success");
|
||||||
|
if (picked && res.model_set === false) {
|
||||||
|
showToast(
|
||||||
|
`Profile created, but the model could not be saved — set it from the profile editor.`,
|
||||||
|
"error",
|
||||||
|
);
|
||||||
|
}
|
||||||
setNewName("");
|
setNewName("");
|
||||||
setNewDescription("");
|
setNewDescription("");
|
||||||
setNoSkills(false);
|
setNoSkills(false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user