Skip to content

fix(console): validate name and cwd client-side before submit - #342

Merged
codeaholicguy merged 1 commit into
mainfrom
fix/323-field-validation
Oct 6, 2026
Merged

codeaholicguy merged 1 commit into
mainfrom
fix/323-field-validation

Conversation

@codeaholicguy

Copy link
Copy Markdown
Owner

Problem

Name regex and cwd existence were only validated inside the spawned agent start subprocess — slow feedback shown as one undifferentiated error.

Approach

validateStartAgentValues (with injectable cwdExists, defaulting to fs.existsSync(path.resolve(cwd))) checks: non-empty name/cwd, the same name regex as agent.ts, and cwd existence. Submit is blocked while errors exist; each error renders inline under its field and clears on edit.

Closes #323

Validation

  • vitest run src/__tests__/tui/console/StartAgentPane.test.ts — 8 passed
  • Pre-commit hooks: full npm run lint + npm run test green

Generated with Devin

@codeaholicguy
codeaholicguy force-pushed the fix/323-field-validation branch 2 times, most recently from 02f116f to d746d35 Compare October 6, 2026 15:35
Name format and cwd existence were only checked inside the spawned
agent start subprocess, surfacing as a slow single undifferentiated
error. The pane now validates per-field on submit: empty fields, the
name regex (same as the CLI), and cwd existence. Errors render inline
under the offending field and clear as the user edits.

Closes #323

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@codeaholicguy
codeaholicguy force-pushed the fix/323-field-validation branch from d746d35 to 9510e17 Compare October 6, 2026 18:42
@codeaholicguy
codeaholicguy merged commit a750445 into main Oct 6, 2026
7 checks passed
@codeaholicguy
codeaholicguy deleted the fix/323-field-validation branch October 6, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent console: validate name and cwd client-side before submit

1 participant