Skip to content

fix(ByoImageValidation): ensure BYO agent validation checks both modelName and byoImage fields - #2451

Open
entee28 wants to merge 4 commits into
kagent-dev:mainfrom
entee28:fix-ui-image-field-validation
Open

fix(ByoImageValidation): ensure BYO agent validation checks both modelName and byoImage fields#2451
entee28 wants to merge 4 commits into
kagent-dev:mainfrom
entee28:fix-ui-image-field-validation

Conversation

@entee28

@entee28 entee28 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

This PR closes #2450

…lName and byoImage fields

Signed-off-by: Thanh Nguyen <puffle.nnt@gmail.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 04:07
@github-actions github-actions Bot added the bug Something isn't working label Aug 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a UI validation bug in the Create/Edit Agent page where the BYO “Container image” field could incorrectly show “Container image is required” on blur even when a non-empty value is present (notably in edit mode with a pre-filled image). This aligns the per-field validation payload with how validateAgentFormData distinguishes between Declarative vs BYO agent types.

Changes:

  • Update validateField("model", ...) to populate both formData.modelName and formData.byoImage, since the same "model" error slot is reused across Declarative (model) and BYO (container image) flows.
  • Add a jsdom regression test that covers the edit-mode BYO blur behavior to ensure the “required” error does not appear when the image is already present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ui/src/app/agents/new/page.tsx Ensures per-field validation sets both modelName and byoImage for the shared "model" validation path, preventing false BYO required errors.
ui/src/lib/tests/ByoImageValidation.test.tsx Adds a regression test validating that a pre-filled BYO image does not trigger the “required” error on first blur in edit mode.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] BYO "Container image" field reports "required" on blur even when a valid value is present

3 participants