Skip to content

[Code Quality] Add typo detection to engine validation error messages #14032

Closed as not planned

Description

@github-actions

Description

When users specify an invalid engine name (e.g., "co-pilot" instead of "copilot"), they receive a generic error listing valid options but no specific guidance about their likely mistake. Adding typo detection would reduce troubleshooting time and improve the user experience.

Current State

File: pkg/workflow/engine_validation.go (lines 68-71)

Current error message:

invalid engine: co-pilot. Valid engines are: copilot, claude, codex, custom.

Example:
engine: copilot

See: [docs URL]

Users must manually compare their input against the valid list.

Suggested Changes

Add common typo detection with specific "Did you mean?" suggestions:

engineValidationLog.Printf("Engine ID %s not found: %v", engineID, err)

// Check for common typos and provide specific guidance
suggestion := ""
switch {
case strings.Contains(strings.ToLower(engineID), "co-pilot") || strings.Contains(strings.ToLower(engineID), "co pilot"):
    suggestion = " Did you mean 'copilot' (no hyphen)?"
case strings.Contains(strings.ToLower(engineID), "claude-3") || strings.Contains(strings.ToLower(engineID), "claude3"):
    suggestion = " Did you mean 'claude' (without version suffix)?"
case strings.Contains(strings.ToLower(engineID), "gpt") || strings.Contains(strings.ToLower(engineID), "openai"):
    suggestion = " Did you mean 'codex' (for OpenAI models)?"
}

return fmt.Errorf("invalid engine: %s.%s Valid engines are: copilot, claude, codex, custom.\\n\\nExample:\\nengine: copilot\\n\\nSee: %s", 
    engineID, suggestion, constants.DocsEnginesURL)

Files Affected

  • pkg/workflow/engine_validation.go (enhance error message with typo detection)
  • pkg/workflow/engine_validation_test.go (add tests for typo detection)

Success Criteria

  • At least 3 common typo patterns detected:
    • "co-pilot" / "co pilot" → suggests "copilot"
    • "claude-3" / "claude3" → suggests "claude"
    • "gpt" / "openai" → suggests "codex"
  • Error messages include "Did you mean?" suggestions when patterns match
  • Unit tests verify typo detection for each pattern
  • Invalid engines without typo matches still get generic error
  • All existing tests pass

Source

Extracted from User Experience Analysis - February 5, 2026

Specific opportunity:

Opportunity 2: Enhance Error Message Clarity in Engine Validation

  • Current: Generic error listing valid options
  • Issue: Doesn't help users understand common mistakes
  • Impact: Reduces troubleshooting time from 2-3 minutes to immediate
  • Why This Matters: Engine configuration errors are common during setup

Priority

Low - Nice-to-have improvement that enhances user experience but doesn't fix a critical issue. Quality-of-life enhancement for better error messages.

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 7, 2026, 1:28 AM UTC

Activity

  1. github-actions commented on Feb 7, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-02-07T01:28:10.757Z.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions