Integrate console formatting with validation errors#12671
Merged
Conversation
…le formatting Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate console formatting with validation errors
Integrate console formatting with validation errors
Jan 30, 2026
Contributor
|
@copilot show example of errors |
Contributor
Author
Here are examples of the formatted validation errors: Before/After ComparisonBefore (plain text): After (with console formatting): Real ExamplesExample 1 - Flag validation: $ gh aw compile --purge test-workflow
✗ --purge flag can only be used when compiling all markdown files (no specific files specified)Example 2 - Incompatible flags: $ gh aw compile --dependabot test.md
✗ --dependabot flag cannot be used with specific workflow filesExample 3 - Invalid path: $ gh aw compile --dir /absolute/path
✗ --dir must be a relative path, got: /absolute/pathExample 4 - Complex parsing error: $ gh aw compile /tmp/invalid-engine.md
✗ failed to parse workflow file: error: at '/engine': 'oneOf' failed, none matched
- at '/engine': value must be one of 'claude', 'codex', 'copilot', 'custom'
- at '/engine': got string, want objectKey Changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validation errors appeared as plain text while other CLI errors used console formatting (✗ prefix, color styling), creating inconsistent user experience.
Changes
New validation output helpers (
pkg/cli/validation_output.go):FormatValidationError(err)- Applies console styling while preserving error structurePrintValidationError(err)- Convenience wrapper for formatting + printing to stderrUpdated compile command (
cmd/gh-aw/main.go):Test coverage (
pkg/cli/validation_output_test.go):GitHubToolsetValidationError)Architecture
Maintains separation of concerns:
Example formatted output:
The helpers are available for future use in other commands that return validation errors.
Original prompt
This section details on the original issue you should resolve
<issue_title>[Code Quality] Integrate console formatting with validation errors</issue_title>
<issue_description>### Description
Bridge the gap between validation errors (currently plain text) and CLI console formatting to provide consistent, styled error display. Currently 0 validation errors use console formatting, leading to inconsistent user experience between validation errors and other CLI output.
Current Situation
Console Formatting Gap:
console.FormatErrorMessage()Current Pattern:
Proposed Architecture
Design Principle: Separation of concerns
This approach:
Implementation Plan
Phase 1: Create Formatting Helper (Day 1)
Create
pkg/cli/validation_output.go:Phase 2: Update CLI Commands (Day 1-2)
Pattern:
Commands to update (minimum 5):
pkg/cli/compile_command.go-RunCompileWorkflowpkg/cli/run_command.go-RunRunWorkflowpkg/cli/mcp_inspect_command.go- inspect operationspkg/cli/audit_command.go- validation failurespkg/cli/compile_validation.go- all validation error printsPhase 3: Testing (Day 2)
Create
pkg/cli/validation_output_test.go:Example Transformation
Before:
$ gh aw compile invalid.md missing required field 'engine'After:
$ gh aw compile invalid.md ✖ missing required field 'engine'. Example: engine: copilot(where ✖ and error text are styled with red color)
Success Criteria
pkg/cli/validation_output.gowithFormatValidationErrorhelperconsole.FormatErrorMessagestylingGitHubToolsetValidationError) preserve structurevalidation_output_test.goverify formatting doesn't alter error contentmake agent-finishsuccessfullyExpected Outcomes
Priority
Medium - User experience improvement
Estimated Effort
Medium (1-2 days)
Files to Create
pkg/cli/validation_output.go(new file)pkg/cli/validation_output_test.go(new file)Files to Update
pkg/cli/compile_command.gopkg/cli/run_command.gopkg/cli/mcp_inspect_command.gopkg/cli/audit_command.gopkg/cli/compile_validation.goRelated Issues
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.