fix(dashboard): surface model-write failure when creating a profile - #38291
Closed
AhmetArif0 wants to merge 1 commit into
Closed
fix(dashboard): surface model-write failure when creating a profile#38291AhmetArif0 wants to merge 1 commit into
AhmetArif0 wants to merge 1 commit into
Conversation
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.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
POST /api/profilesreturnsmodel_set: falsewhen the profile is created successfully but the follow-up model assignment step fails (e.g. filesystem error writingconfig.yaml).handleCreateon the Profiles page discarded the entire response with a bareawait: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 (
pickedis truthy) butres.model_setcame backfalse:Strict
=== falsemeans the warning is silently skipped whenmodel_setisundefined(older server that predates the field), keeping backwards compatibility.Test plan
model_set