Skip to content

feat: improve validation error messages with actionable guidance#44

Merged
aswhitehouse merged 2 commits intomainfrom
fix/improve-yaml-validation-errors
Mar 12, 2026
Merged

feat: improve validation error messages with actionable guidance#44
aswhitehouse merged 2 commits intomainfrom
fix/improve-yaml-validation-errors

Conversation

@sgriffiths
Copy link
Contributor

Summary

Resolves the conflict from PR #27 by @aicontentcreate2023-star (Chu Julung) and applies the enhanced error message pattern to the current codebase. Closes #24.

  • All validation errors now show actual type received vs expected (e.g., got int)
  • Field paths included in every error (e.g., tasks.my_task.input)
  • YAML examples provided for missing/incorrect fields
  • Available options listed when tool/task references fail
  • Array indices shown for collection errors (e.g., tools[1].id)
  • Missing section detection with full add-it-like-this guidance
  • Enhanced messages applied to all validators including multi-step task validation added since PR feat: improve validation error messages for invalid YAML specs #27

Before/After

# Before
ValueError: agent.name must be a string

# After  
ValueError: Field 'agent.name' must be a string, got int.
Example: agent:
  name: "my-agent"
# Before
ValueError: task my_task references non-existent tool 'web_search'

# After
ValueError: tasks.my_task references non-existent tool 'web_search'.
Available tools: 'file_reader', 'calculator'. Check your 'tools' section.

Test plan

  • 25 new tests in tests/test_validation_errors.py — all passing
  • All 101 existing tests still pass (100 passed, 1 skipped)
  • Ruff lint clean
  • No breaking changes — still raises ValueError

Co-authored-by: Chu Julung chujulung@ChudeMacBook-Air.local

Resolves the conflict from PR #27 (by Chu Julung) by applying enhanced
error message patterns to the current validator codebase. All errors now
show the actual type received, expected type, field path, and YAML
examples. Tool/task reference errors list available options.

Co-authored-by: Chu Julung <chujulung@ChudeMacBook-Air.local>
@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-agent-spec Ready Ready Preview, Comment Mar 11, 2026 11:16pm

Request Review

@aswhitehouse aswhitehouse merged commit b101834 into main Mar 12, 2026
3 checks passed
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.

Improve error messages for invalid YAML specs

2 participants