[repository-quality] Repository Quality: Error Message Consistency & Actionability (2026-04-07) #25095
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Repository Quality Improvement Agent. A newer discussion is available at Discussion #25307. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report — Actionable Error UX
Analysis Date: 2026-04-07
Focus Area: Error Message Consistency & Actionability
Strategy Type: Custom (first run — no prior history)
Custom Area: Yes — Identified by analyzing the inconsistency between 1,790 error-producing locations and only 13 production uses of
FormatErrorWithSuggestions, despite the infrastructure existing to provide structured, actionable error guidance.Executive Summary
This analysis examined error message quality across the gh-aw codebase, focusing on whether users who hit errors during workflow compilation or execution receive actionable guidance to resolve the problem. With 1,790 total error-producing locations spanning
pkg/workflow(517),pkg/cli(978), andpkg/parser(253), only ~0.7% use the dedicatedFormatErrorWithSuggestionshelper that provides structured bullet-point suggestions.The codebase has a clear inconsistency problem in error message approach. Some modules are excellent (e.g.,
pkg/workflow/mcp_config_validation.goembeds inline YAML examples and docs URLs in every error). Other modules likepkg/parser/schema_validation.goproduce terse, one-liner messages with no guidance. TheFormatErrorWithSuggestionshelper is available and used by 13 production paths, but the majority of user-facing compilation errors do not use it.This is a high-impact area for developer experience: when
gh aw compilefails, users need to know exactly what to change and where. Inconsistent error UX erodes trust and increases support load.Full Analysis Report
Focus Area: Error Message Consistency & Actionability
Current State Assessment
Metrics Collected:
FormatErrorWithSuggestionsproduction uses%wwrappingmcp_config_validation.go)schema_validation.go,schema_triggers.go)pkg/tty,pkg/types)Findings
Strengths
pkg/workflow/mcp_config_validation.gois exemplary: every error includes an inline YAML snippet, an explanation of the rule, and a docs URL. This is the gold standard for this codebase.fmt.Errorfwith%wwrapping is widely used (962 uses), ensuring errors chain correctly for debugging.FormatErrorWithSuggestionshelper exists inpkg/console/render.goand is already used in 13 key user-facing paths (compile-not-found, run errors, log download).tools_validation.go) embeds actionable descriptions inline, e.g.,"Use 'bash: true' (enable all commands), 'bash: false' (disable), or 'bash: [\"cmd1\", \"cmd2\"]' (specific commands). Run 'gh aw fix' to automatically migrate".Areas for Improvement
pkg/parser/schema_validation.go: Two terse errors like"field '%s' cannot be used in shared workflows (only allowed in main workflows with 'on' trigger)"— no example showing correct usage. Severity: Highpkg/parser/schema_triggers.go: Long inline explanation text included directly infmt.Errorfstrings instead of usingFormatErrorWithSuggestions. The messages are good but hard to format consistently. Severity: Mediumpkg/parser/remote_fetch.go: Errors like"invalid workflowspec: must be owner/repo/path[@ref]"— valid format is shown but no example, no docs link. Severity: Mediumpkg/workflow/compiler_jobs.go: Internal errors like"failed to build main job: %w"bubble up to users without contextual guidance. Severity: MediumInconsistency: Three different patterns used across the codebase:
FormatErrorWithSuggestions(structured bullet points)fmt.Errorfstrings (mcp_config_validation style)No single standard is enforced.
Detailed Analysis
The core issue is the lack of a project-wide standard for "when and how to add actionable guidance to errors". The
mcp_config_validation.goapproach (inline YAML + docs URL) is excellent for configuration errors where the fix is a specific YAML change. TheFormatErrorWithSuggestionsapproach is better for runtime/workflow resolution errors where the fix is a CLI command. Terse errors are only appropriate for internal/programming errors not shown to end users.The impact multiplier is high: gh-aw targets developers writing agentic workflows, a relatively new skill domain. When compilation fails, users need immediate, specific guidance to proceed. Each additional second spent searching docs represents friction that reduces adoption.
🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: The following tasks are designed for GitHub Copilot coding agent execution. Please split these into individual work items for Copilot to process sequentially.
Task 1: Add Actionable Suggestions to Parser Shared-Workflow Validation Errors
Priority: High
Estimated Effort: Small
Focus Area: Error Message Actionability
Description:
pkg/parser/schema_validation.gocontains two terse validation errors for shared workflows that lack any guidance on how to fix the issue. These are user-facing compilation errors shown when someone incorrectly adds trigger-specific fields to a shared workflow file.Acceptance Criteria:
schema_validation.gouseFormatErrorWithSuggestionsor include inline suggestionsmake test-unit)Code Region:
pkg/parser/schema_validation.go(lines ~39–41)Task 2: Convert Inline Trigger Conflict Errors to Structured Suggestions
Priority: High
Estimated Effort: Small
Focus Area: Error Message Consistency
Description:
pkg/parser/schema_triggers.gocontains two verbosefmt.Errorfstrings that embed long explanation text inline (lines 63–65). The intent is good but the format is inconsistent with theFormatErrorWithSuggestionspattern used elsewhere. These should be refactored to use structured suggestions.Acceptance Criteria:
schema_triggers.gouseFormatErrorWithSuggestionsmake fmt && make test-unitafter making changesCode Region:
pkg/parser/schema_triggers.go(lines ~63–65)Task 3: Add Docs URL References to Remote Fetch Validation Errors
Priority: Medium
Estimated Effort: Small
Focus Area: Error Message Discoverability
Description:
pkg/parser/remote_fetch.goandpkg/parser/remote_fetch_wasm.gocontain several errors for invalid workflow import paths (e.g.,"invalid workflowspec: must be owner/repo/path[@ref]") that show the format but no example and no docs URL. These appear when users write incorrect import syntax.Acceptance Criteria:
"invalid workflowspec"error includes a concrete import example likeimports: github/gh-aw/.github/aw/shared.md@mainremote_fetch.goandremote_fetch_wasm.gomake fmt && make test-unitafter changesCode Region:
pkg/parser/remote_fetch.go(line ~270),pkg/parser/remote_fetch_wasm.goTask 4: Add Error Message Style Guide to Contributing Documentation
Priority: Medium
Estimated Effort: Medium
Focus Area: Long-term Consistency
Description:
The codebase has three different styles for adding actionable guidance to errors, and no documented standard. Adding a short style guide to
CONTRIBUTING.mdorDEVGUIDE.mdwill ensure future contributors use consistent patterns. The guide should document when to use each pattern with before/after examples.Acceptance Criteria:
CONTRIBUTING.mdorDEVGUIDE.mdhas a new section "Error Message Guidelines"FormatErrorWithSuggestions— for user-facing CLI/workflow errors with bullet suggestionsfmt.Errorf— for configuration validation errors (mcp_config_validation style)fmt.Errorf— only for internal/programming errors not shown to userspkg/console/render.gofor the helper functionCode Region:
CONTRIBUTING.mdorDEVGUIDE.md📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
schema_validation.goshared-workflow errors — Priority: High (30 min)FormatErrorWithSuggestions— Priority: High (30 min)Short-term Actions (This Month)
Long-term Actions (This Quarter)
📈 Success Metrics
Track these metrics to measure improvement in Error Message Actionability:
pkg/workflowcompilation errors with guidance: ~20% → 60%Next Steps
grep -r FormatErrorWithSuggestions --include="*.go" pkg/ | wc -lFormatErrorWithSuggestionsusesReferences:
Beta Was this translation helpful? Give feedback.
All reactions