You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model edit form: pencil button triggers a save API call #1947
While editing an existing ModelConfig (/models/new?edit=true), there are two related problems with the model name field and its pencil ("Edit Auto-Generated Name") button.
Issue 1 — Clicking the pencil icon fires an API call (saves the form)
Clicking the pencil icon to edit the name immediately triggers a server-side update call (updateModelConfig) instead of just enabling name editing. The form gets submitted, the model is saved, and the page navigates away — so you can't actually edit anything.
Captured request on pencil click:
POST /models/new?edit=true&name=ollama-mistral&namespace=kagent
payload: ["kagent/ollama-mistral",{"apiKey":null,"spec":{"model":"mistral","provider":"Ollama","ollama":{}}}]
Screen.Recording.2026-05-30.164355.mp4
Issue 2 — After fixing Issue 1, the name is editable but the change is useless
Once the pencil no longer submits and you can actually type a new name and save, the new name still doesn't take
effect — the model keeps its original name.
Cause: a ModelConfig is a Kubernetes resource, and its metadata.name is immutable — Kubernetes does not allow renaming a resource via update. The update only changes the spec, never the name.
@peterj can you check this? Since the model name is immutable in the CRD, I think we should hide the name-edit
pencil in edit mode (it currently lets you "rename" but the change is silently dropped). I can raise a PR.
I'd like to pick this up — could it be assigned to me?
In ui/src/components/models/new/BasicInfoSection.tsx, the "Edit Auto-Generated Name" pencil is rendered as a <Button> without an explicit type. Since it's inside a form, it defaults to type="submit", causing updateModelConfig to be triggered when the pencil is clicked. The model-fetch button directly below already specifies type="button".
My proposed fix is to add type="button" to the pencil button and verify that clicking it no longer submits the form or invokes updateModelConfig.
Activity
gauravshinde1729 commentedon May 30, 2026
@peterj can you check this? Since the model name is immutable in the CRD, I think we should hide the name-edit
pencil in edit mode (it currently lets you "rename" but the change is silently dropped). I can raise a PR.
Valyrian-Code commentedon Jun 8, 2026
I'd like to pick this up — could it be assigned to me?
In
ui/src/components/models/new/BasicInfoSection.tsx, the "Edit Auto-Generated Name" pencil is rendered as a<Button>without an explicittype. Since it's inside a form, it defaults totype="submit", causingupdateModelConfigto be triggered when the pencil is clicked. The model-fetch button directly below already specifiestype="button".My proposed fix is to add
type="button"to the pencil button and verify that clicking it no longer submits the form or invokesupdateModelConfig.fix(ui): fix model name editing on the model config form (#1979)