Skip to content

fix(dashboard): surface model-write failure when creating a profile - #38291

Closed
AhmetArif0 wants to merge 1 commit into
NousResearch:mainfrom
AhmetArif0:fix/desktop-profiles-model-set-warning
Closed

fix(dashboard): surface model-write failure when creating a profile#38291
AhmetArif0 wants to merge 1 commit into
NousResearch:mainfrom
AhmetArif0:fix/desktop-profiles-model-set-warning

Conversation

@AhmetArif0

Copy link
Copy Markdown
Contributor

Problem

POST /api/profiles returns model_set: false when the profile is created successfully but the follow-up model assignment step fails (e.g. filesystem error writing config.yaml). handleCreate on the Profiles page discarded the entire response with a bare await:

await api.createProfile({ ..., provider: picked?.provider, model: picked?.model });
showToast(`${t.profiles.created}: ${name}`, "success");

The user sees a "Profile created" success toast with no indication that their chosen model was not persisted. They then need to discover the mismatch themselves from the profile editor.

Fix

Capture the response and show a follow-up error toast when the user explicitly selected a model (picked is truthy) but res.model_set came back false:

const res = await api.createProfile({ ... });
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",
  );
}

Strict === false means the warning is silently skipped when model_set is undefined (older server that predates the field), keeping backwards compatibility.

Test plan

  • Create a profile with a model selected, backend write succeeds → only success toast shown
  • Simulate model write failure (e.g. make the profile config.yaml read-only) → success toast followed by the model-failure error toast
  • Create a profile with no model selected → only success toast, no model warning regardless of model_set

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.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have labels Jun 3, 2026
@teknium1

teknium1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #39070. Your commit was cherry-picked onto current main as c2d11cc with your authorship preserved in git log. Thanks!

@teknium1 teknium1 closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants