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:
@ -414,7 +414,7 @@ export default function ProfilesPage() {
|
||||
(c) => `${c.provider}\u0000${c.model}` === modelChoice,
|
||||
)
|
||||
: undefined;
|
||||
await api.createProfile({
|
||||
const res = await api.createProfile({
|
||||
name,
|
||||
clone_from_default: cloneAll ? false : cloneFromDefault,
|
||||
clone_all: cloneAll,
|
||||
@ -424,6 +424,12 @@ export default function ProfilesPage() {
|
||||
model: picked?.model,
|
||||
});
|
||||
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("");
|
||||
setNewDescription("");
|
||||
setNoSkills(false);
|
||||
|
||||
Reference in New Issue
Block a user