Skip to content

Model edit form: pencil button triggers a save API call #1947

@gauravshinde1729

Description

@gauravshinde1729

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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions