Skip to content

Bug: agent editor Save never validates client-side — required fields (display name, instructions, models) are decorative #2665

Closed

Description

@yannickmonney

Problem

The agent editor's Save is never gated on validity: the EditorController hardcodes isValid: true, and Save disables only on !isValid (plus dirty/saving/loading). So clearing the required Display name or System instructions, or removing all models, leaves Save enabled; the save then fails server-side (agentJsonSchema.parse → VALIDATION_ERROR) and surfaces a generic destructive toast with no inline field error pointing at what's wrong.

Current behaviour

Code-grounded (2026-07-11, main @ 94ef84e); the isValid: true literal and the disable logic are unambiguous:

  • app/features/agents/components/agent-navigation.tsx:303 — isValid: true (hardcoded in the controller)
  • app/components/ui/editor/editor-actions.tsx:144-148 — saveDisabled = !isDirty || isSaving || !isValid || isLoading
  • index.tsx:552 (Display name) / instructions.tsx:538 (System instructions) marked required but unenforced
  • convex/agents/file_actions.ts:532 — server agentJsonSchema.parse throws VALIDATION_ERROR; toast at agent-navigation.tsx:274-278

Repro: open E2E Assistant → General → clear Display name → Save stays enabled → click Save → generic red toast, no field highlight.

Proposed change

Compute real isValid from the required fields (non-empty display name + system instructions, ≥1 model) and feed it to the controller so Save disables and the offending field shows an inline error.

Acceptance criteria

  • Save is disabled while a required agent field is empty / no model is selected
  • The invalid field shows an inline, localized error
  • Server rejection can no longer be reached via the UI for these fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions