Skip to content

Add file:line:col position to engine validation error messages#18732

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/add-file-line-col-position
Closed

Add file:line:col position to engine validation error messages#18732
Copilot wants to merge 3 commits intomainfrom
copilot/add-file-line-col-position

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Engine validation errors (e.g., invalid engine: claud) lacked source position info, inconsistent with YAML and schema errors that include file:line:col. The "Example:" also always showed engine: copilot regardless of the closest match.

Changes

  • engine_validation.go: Changed validateEngine signature to accept filePath string, line int, column int; uses formatCompilerErrorWithPosition for consistent error formatting; "Example:" now reflects the closest suggestion when one exists
  • compiler_orchestrator_engine.go: Scans result.FrontmatterLines to find the actual line of the engine: key before calling validateEngine, passing accurate source position
  • Tests: Updated all validateEngine call sites to pass the new parameters

Before / After

Before:

invalid engine: claud. Valid engines are: copilot, claude, codex.

Did you mean: claude?

Example:
engine: copilot

After:

workflow.md:3:1: error: invalid engine: claud. Valid engines are: copilot, claude, codex.

Did you mean: claude?

Example:
engine: claude

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE 64/bin/go node t-41�� k/gh-aw/gh-aw/.github/workflows/bot-detection.md go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 7nNg/K35Gj9RoPo_git GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name /usr/bin/git /tmp/go-build246gh -trimpath /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git tags/v5 -goversion /opt/hostedtoolc--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name /usr/bin/git se 5059796/b108/vetrev-parse /usr/bin/gh git rev-�� --show-toplevel 5059796/b416/importcfg /usr/bin/git k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pkrev-parse .cfg git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha -json GO111MODULE 5059796/b383/vet.cfg GOINSECURE GOMOD GOMODCACHE go env -json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git GOMODCACHE 3200437/b398/imprev-parse /usr/bin/git git rev-�� --show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 4243-28888/test-2131327222/.github/workflows GO111MODULE .cfg GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel V_9LLtYheNxUI/rcVLHjwofsbGz_Wa5yJE/ljgChBZHiD7WnPIlg48W/J-s6rDiVremote.origin.url /usr/bin/git ithub-script/gitgit GO111MODULE 5059796/b411/_pk--show-toplevel git stat�� GOMODCACHE go /usr/bin/git -json GO111MODULE /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuREDACTED (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -bool -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git -C /tmp/gh-aw-test-runs/20260227-184243-28888/test-2336996495/.github/workflows rev-parse 5059796/b424/vet.cfg -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git -json GOMOD 64/bin/go git rev-�� --show-toplevel go /usr/bin/infocmp -json GO111MODULE 64/bin/go infocmp (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha /ref/tags/v8 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x-test.short=true GOINSECURE GOMOD GOMODCACHE go env 4243-28888/test-2829508433 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go l GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha 5059796/b001/gh-aw.test GO111MODULE Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE zR1FoocMnSvjj/uK_3BCG-yry8f90VTkWc/33MKnog8acjadb_CbEmj/zt0zFYBz-dwarf=false env runs/20260227-184243-28888/test-3394434189/.github/workflows GO111MODULE 5059796/b001/_pkg_.a GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha run --auto /usr/bin/git --detach k/gh-aw/gh-aw/pkrev-parse 64/bin/go git rev-�� --show-toplevel /opt/hostedtoolc-goversion /opt/hostedtoolcache/node/24.13.1/x64/bin/node ub/workflows -trimpath 64/bin/go node (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ript formatting GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -json GO111MODULE Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 5059796/b285/vet.cfg GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --get remote.origin.urrev-parse /usr/lib/git-cor--show-toplevel git rev-�� --show-toplevel /usr/lib/git-core/git 7912282/b431/workflow.test run --auto /usr/bin/git 7912282/b431/workflow.test (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha 5059796/b001/_pkg_.a GO111MODULE 5059796/b001=> GOINSECURE GOMOD GOMODCACHE go env 4243-28888/test-2829508433 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go l GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git k/gh-aw/gh-aw/.ggit remote.origin.urrev-parse ache/node/24.13.--show-toplevel git rev-�� --show-toplevel ache/node/24.13.1/x64/bin/node /usr/bin/git test.txt node /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 go /usr/bin/basename -json GO111MODULE /opt/hostedtoolc--show-toplevel basename /tmp�� GOMODCACHE go /usr/bin/git image:v1.0.0 GO111MODULE /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE 64/bin/go Action pins syngit GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 EF84jMl68jl3s/fr2q424HmZcMwOTyCJ8U/GjoicMhJxZxwQremote.origin.url c3b5e9b5ee8d77508f176400cb733d6ea075359f252d4baa-d ry=1 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 go /usr/bin/git CJ8U/fr2q424HmZcgit GO111MODULE /opt/hostedtoolc--show-toplevel git add initial.txt go 64/pkg/tool/linux_amd64/link -json 5059796/b393/_terev-parse ache/node/24.13.--show-toplevel 64/pkg/tool/linux_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 go /usr/bin/head XQQB/tRuxqCKga2Pgit GO111MODULE ache/go/1.25.0/x--show-toplevel head -500�� /tmp/gh-aw/aw-master.patch ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pkrev-parse ache/node/24.13.--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 go At,event,headBranch,headSha,displayTitle aMuV/7skKEFF9rwZgit l 5059796/b407/par--show-toplevel git init�� GOMODCACHE 5059796/b407/parser.test /usr/bin/git t0 5059796/b400/_terev-parse ps git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 go /usr/bin/git runs/20260227-18git GO111MODULE 5059796/b414/sli--show-toplevel git conf�� user.name Test User /usr/bin/git t0 GO111MODULE (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 go /usr/bin/git runs/20260227-18git GO111MODULE 1/x64/bin/node git add . ache/go/1.25.0/x64/pkg/tool/linujournal-or-kmsg /usr/bin/git ithub/workflows/git GO111MODULE 64/pkg/tool/linu--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path 35126d5394e2a1caGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 3200437/b409/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/testdescribe GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE go env Pv9Y/I_ChFL29QhoGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD run-script/lib/n--show-toplevel 3200437/b354/importcfg (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build2587912282/b381/cli.test /tmp/go-build2587912282/b381/cli.test -test.testlogfile=/tmp/go-build2587912282/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -json GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel -tests /usr/bin/git 2110168051/.githgit GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git 64/bin/node --show-toplevel go x_amd64/vet git 1/x6�� --show-toplevel x_amd64/vet /usr/bin/git /repos/actions/sgit --jq /usr/bin/git git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 3531660342/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha gh-aw/actions/setup/sh/sanitize_path.sh' '/usr/bin:/usr/local/bin:::' && echo "$PATH" go /usr/bin/git ty-test.md GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/link git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel go x_amd64/link git rev-�� --show-toplevel x_amd64/link /usr/bin/git /repos/actions/sgit --jq /usr/bin/git /usr/bin/git (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion -json GO111MODULE /usr/bin/gcc 64/pkg/tool/linux_amd64/vet rev-�� HEAD gcc /usr/bin/git ons-test70938806git c clusion,workflow--show-toplevel git (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD erignore ache/go/1.25.0/xGO111MODULE env 3200437/b415/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD erignore ache/go/1.25.0/xGO111MODULE env 3200437/b417/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 86_64/node le-frontmatter.mgit GO111MODULE x_amd64/link git 1/x6�� --show-toplevel x_amd64/link /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build2465059796/b381/cli.test /tmp/go-build2465059796/b381/cli.test -test.testlogfile=/tmp/go-build2465059796/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE erignore m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /tmp/go-build2587912282/b381/cli.test /tmp/go-build2587912282/b381/cli.test -test.testlogfile=/tmp/go-build2587912282/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -json GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name d7ab9ec12dbe903eGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 3200437/b407/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/styl+x GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -v go 86_64/node -json GO111MODULE x_amd64/vet git 1/x6�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch --show-toplevel git /usr/bin/git --show-toplevel -extld=gcc /tmp/go-build246--show-toplevel git rev-�� --show-toplevel /tmp/go-build246test@example.com /usr/bin/git -test.paniconexi/usr/bin/git -test.v=true /usr/bin/git git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Add file:line:col position to engine validation error messages</issue_title>
<issue_description>## Objective

Add file, line, and column position information to engine validation errors in pkg/workflow/engine_validation.go so they are consistent with YAML and schema errors.

Context

From issue #18726 (Test Case 2, score 71/100): Engine validation errors like "invalid engine: claud" lack file location info, while YAML and schema errors include file:line:col. This inconsistency makes it harder to locate the error in the source file.

Also, the example shown (engine: copilot) should reflect the corrected value (engine: claude) rather than a generic example.

Approach

  1. In pkg/workflow/engine_validation.go, thread the source position (file path, line, column) through to the error formatting call. The position is likely available from the frontmatter parsing context — locate where validateEngine is called and pass the position down.

  2. Use the existing console error formatting (e.g., console.FormatPositionedError or equivalent) to prepend file:line:col: to the engine validation error, consistent with other errors.

  3. Update the "Example:" in the engine error message to show the corrected value (the closest match) rather than a hardcoded engine: copilot:

    Did you mean: claude?
    
    Example: engine: claude
    

Files to Modify

  • pkg/workflow/engine_validation.go — accept/pass position, format error with location prefix, fix example value
  • Callers of engine validation — pass position information if not already available

Acceptance Criteria

Generated by Plan Command for issue #18726

  • expires on Mar 1, 2026, 6:28 PM UTC

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 27, 2026 18:40
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Change validateEngine to accept filePath, line, column parameters
- Use formatCompilerErrorWithPosition for consistent error format
- Fix Example: to show closest match suggestion instead of hardcoded engine: copilot
- Find engine: line in frontmatter at call site for accurate position
- Update tests to pass new parameters

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add file, line, and column position to validation error messages Add file:line:col position to engine validation error messages Feb 27, 2026
@pelikhan pelikhan marked this pull request as ready for review February 27, 2026 18:55
Copilot AI review requested due to automatic review settings February 27, 2026 18:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances engine validation error messages by adding source position information (file:line:col) and displaying the closest matching engine in the example instead of a hardcoded "copilot" value. The changes address issue #18726 to improve error message consistency with YAML and schema errors.

Changes:

  • Modified validateEngine to accept file path, line, and column parameters for positioned error formatting
  • Updated error messages to show the suggested engine in the example section
  • Implemented line detection logic in the orchestrator to find the actual engine: line in frontmatter
  • Updated all test call sites to provide the new position parameters

Reviewed changes

Copilot reviewed 167 out of 167 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/workflow/engine_validation.go Added position parameters to validateEngine signature; uses formatCompilerErrorWithPosition for consistent error formatting; example now shows closest match instead of hardcoded "copilot"
pkg/workflow/compiler_orchestrator_engine.go Scans frontmatter lines to detect engine key position before validation; passes accurate line/column to validateEngine
pkg/workflow/error_message_quality_test.go Updated validateEngine calls to include new position parameters
pkg/workflow/engine_validation_test.go Updated all test cases to pass position parameters to validateEngine
.github/workflows/*.lock.yml Updated GitHub Actions artifact action versions from v6 to v7/v8
.github/workflows/agentics-maintenance.yml Updated artifact upload action version
.github/workflows/chroma-issue-indexer.lock.yml Updated actions/cache from v4.3.0 to v5.0.3
.github/workflows/ai-moderator.lock.yml Updated actions/cache from v4.3.0 to v5.0.3
.github/workflows/metrics-collector.lock.yml Updated actions/setup-go from v6.2.0 to v6.3.0
.github/workflows/example-workflow-analyzer.lock.yml Updated actions/setup-go from v6.2.0 to v6.3.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +216 to +223
engineLine, engineCol := 1, 1
for i, fmLine := range result.FrontmatterLines {
trimmed := strings.TrimSpace(fmLine)
if strings.HasPrefix(trimmed, "engine:") || trimmed == "engine" {
engineLine = result.FrontmatterStart + i
break
}
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line number calculation may be incorrect. FrontmatterStart is always 2 (line after opening ---), and i is the 0-based index in FrontmatterLines. This means:

  • If engine: is on the first line of frontmatter content, i would be 0
  • The calculation result.FrontmatterStart + i would be 2 + 0 = 2
  • But this is correct - line 2 is indeed the first content line after ---

However, the column is hardcoded to 1, which may not be accurate if there's leading whitespace before engine:. The column should ideally be calculated based on the actual position of engine: in the trimmed vs original line.

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan closed this Feb 28, 2026
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.

[plan] Add file:line:col position to engine validation error messages

3 participants