Skip to content

fix: simplify max-turns error message by removing contradictory example - #18009

Merged
pelikhan merged 5 commits into
mainfrom
copilot/fix-max-turns-error-message
Feb 24, 2026
Merged

fix: simplify max-turns error message by removing contradictory example#18009
pelikhan merged 5 commits into
mainfrom
copilot/fix-max-turns-error-message

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

The max-turns not supported error for the Copilot engine was self-contradictory — it told users to remove max-turns, then showed an example using copilot with max-turns (which also doesn't support it).

Change

Simplified the error message in pkg/workflow/agent_validation.go to remove the misleading example entirely:

Before:

max-turns not supported: engine 'copilot' does not support the max-turns feature. Use engine: copilot or remove max-turns from your configuration. Example:
engine:
  id: copilot
  max-turns: 5

After:

max-turns not supported: engine 'copilot' does not support the max-turns feature
Original prompt

This section details on the original issue you should resolve

<issue_title>Confusing error message: max-turns not supported example contradicts the error</issue_title>
<issue_description>## Bug

The compilation error for max-turns on the Copilot engine is self-contradictory. It tells you max-turns is not supported, then shows an example using max-turns:

max-turns not supported: engine 'copilot' does not support the max-turns feature.
Use engine: copilot or remove max-turns from your configuration. Example:
engine:
  id: copilot
  max-turns: 5
✗ compilation failed

Expected behavior

The error message should either:

  1. Not include max-turns in the example (if Copilot genuinely doesn't support it):

    max-turns not supported: engine 'copilot' does not support the max-turns feature.
    Remove max-turns from your configuration.
    
  2. Or, if the example is meant to show valid usage, make it clear that the example is the fix (though currently it looks identical to what would cause the error).

Reproduction

Add max-turns to a Copilot engine workflow and compile:

engine:
  id: copilot
  max-turns: 5
gh aw compile
```</issue_description>

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

<comments>
<comment_new><author>@pelikhan</author><body>
@copilot show example for claude or an agentic engine that supports the feature.</body></comment_new>
</comments>


💡 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.



✨ PR Review Safe Output Test - Run 22331673771

💥 [THE END] — Illustrated by Smoke Claude

… copilot

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix confusing error message for max-turns support fix: correct max-turns error message to show claude example instead of copilot Feb 24, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot remove this part of the mssage

Remove max-turns from your configuration, or switch to an engine that supports it (e.g., claude). Example:
engine:
  id: claude
  max-turns: 5

@github-actions

Copy link
Copy Markdown
Contributor

Commit pushed: 7b9bd45

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot apply comment in #18009 (comment)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove this part of the mssage

...

Done in 7d7bb31. The error message is now simply:

max-turns not supported: engine 'copilot' does not support the max-turns feature

Copilot AI changed the title fix: correct max-turns error message to show claude example instead of copilot fix: simplify max-turns error message by removing contradictory example Feb 24, 2026
@pelikhan
pelikhan marked this pull request as ready for review February 24, 2026 01:20
Copilot AI review requested due to automatic review settings February 24, 2026 01:20
@pelikhan
pelikhan merged commit 7d65d72 into main Feb 24, 2026
44 checks passed
@pelikhan
pelikhan deleted the copilot/fix-max-turns-error-message branch February 24, 2026 01:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a confusing and self-contradictory error message for the max-turns feature validation. The original error told users that the Copilot engine doesn't support max-turns, but then showed an example configuration that incorrectly used max-turns with the Copilot engine.

Changes:

  • Simplified the error message in agent_validation.go to remove the misleading example and contradictory guidance
  • Added a smoke test artifact file

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
smoke-test-22331673771.json Smoke test artifact file (automated test output)
pkg/workflow/agent_validation.go Simplified the max-turns not supported error message by removing the self-contradictory example

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

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot apply comment in #18009 (comment)

Already applied in 7d7bb31. The error message is:

max-turns not supported: engine 'copilot' does not support the max-turns feature

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.

Confusing error message: max-turns not supported example contradicts the error

3 participants