Skip to content

Fix trailing commas in agent tools arrays causing empty tool names (400 API error)#1543

Merged
aaronpowell merged 1 commit intogithub:stagedfrom
ilderaj:fix/trailing-comma-empty-tool-name
Apr 29, 2026
Merged

Fix trailing commas in agent tools arrays causing empty tool names (400 API error)#1543
aaronpowell merged 1 commit intogithub:stagedfrom
ilderaj:fix/trailing-comma-empty-tool-name

Conversation

@ilderaj
Copy link
Copy Markdown
Contributor

@ilderaj ilderaj commented Apr 28, 2026

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, or workflow file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, or workflow with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.
  • I am targeting the staged branch for this pull request.

Description

Three agent files have a trailing comma after the last element in their tools YAML flow-sequence arrays. When Copilot parses these files, the trailing comma produces an empty string as an extra tool entry. The Copilot API then rejects the entire request with:

CAPIError: 400 Invalid 'tools[N].function.name': empty string.
Expected a string with minimum length 1, but got an empty string instead.

This causes all tasks run via Copilot CLI to fail completely whenever any of these three agents are installed — even if the user is not actively using those agents, because installed plugins contribute to the global tools array for every session.

Affected files:

  • agents/kusto-assistant.agent.md — trailing comma after vscodeAPI
  • agents/mentoring-juniors.agent.md — trailing comma after usages
  • agents/address-comments.agent.md — trailing comma after github

Fix: Remove the trailing comma from the last element of each tools array.


Type of Contribution

  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.

Additional Notes

The YAML flow-sequence syntax used in these files (tools: [ "a", "b", ]) does not permit trailing commas — unlike JSON5 or JavaScript arrays. The fix is a 1-character removal per file.

Reproducible with any Copilot CLI task when these agents are installed. Error surfaced in VS Code Copilot Chat agent mode as well.


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Three agent files had a trailing comma after the last element in their
YAML flow-sequence tools arrays. When parsed, this produces an empty
string as an extra tool entry, which the Copilot API rejects with:

  CAPIError: 400 Invalid 'tools[N].function.name': empty string

Affected files:
- agents/kusto-assistant.agent.md
- agents/mentoring-juniors.agent.md
- agents/address-comments.agent.md
Copilot AI review requested due to automatic review settings April 28, 2026 13:55
@ilderaj ilderaj requested a review from aaronpowell as a code owner April 28, 2026 13:55
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Skill Validator Results

⛔ Findings need attention

Scope Checked
Skills 1
Agents 3
Total 4
Severity Count
--- ---:
❌ Errors 6
⚠️ Warnings 0
ℹ️ Advisories 0

Summary

Level Finding
[agent:Universal PR Comment Addresser] Agent name 'Universal PR Comment Addresser' does not match filename 'address-comments.agent.md' (expected 'Universal PR Comment Addresser.agent.md').
[agent:Universal PR Comment Addresser] Agent name 'Universal PR Comment Addresser' contains invalid characters — must be lowercase alphanumeric and hyphens only.
[agent:Kusto Assistant] Agent name 'Kusto Assistant' does not match filename 'kusto-assistant.agent.md' (expected 'Kusto Assistant.agent.md').
[agent:Kusto Assistant] Agent name 'Kusto Assistant' contains invalid characters — must be lowercase alphanumeric and hyphens only.
[agent:Sensei - Junior Mentor] Agent name 'Sensei - Junior Mentor' does not match filename 'mentoring-juniors.agent.md' (expected 'Sensei - Junior Mentor.agent.md').
[agent:Sensei - Junior Mentor] Agent name 'Sensei - Junior Mentor' contains invalid characters — must be lowercase alphanumeric and hyphens only.
Full validator output ```text Found 3 agent(s) ❌ [agent:Universal PR Comment Addresser] Agent name 'Universal PR Comment Addresser' does not match filename 'address-comments.agent.md' (expected 'Universal PR Comment Addresser.agent.md'). ❌ [agent:Universal PR Comment Addresser] Agent name 'Universal PR Comment Addresser' contains invalid characters — must be lowercase alphanumeric and hyphens only. ❌ [agent:Kusto Assistant] Agent name 'Kusto Assistant' does not match filename 'kusto-assistant.agent.md' (expected 'Kusto Assistant.agent.md'). ❌ [agent:Kusto Assistant] Agent name 'Kusto Assistant' contains invalid characters — must be lowercase alphanumeric and hyphens only. ❌ [agent:Sensei - Junior Mentor] Agent name 'Sensei - Junior Mentor' does not match filename 'mentoring-juniors.agent.md' (expected 'Sensei - Junior Mentor.agent.md'). ❌ [agent:Sensei - Junior Mentor] Agent name 'Sensei - Junior Mentor' contains invalid characters — must be lowercase alphanumeric and hyphens only. Validated 3 agent(s)

{Ansi.Red}Agent spec conformance failures — fix the errors above.{Ansi.Reset}

</details>
> **Note:** The validator returned a non-zero exit code. Please review the findings above before merge.

Copy link
Copy Markdown
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

Fixes invalid agent frontmatter in agents/*.agent.md where trailing commas in tools YAML flow-sequence arrays can introduce an empty tool name and cause Copilot API 400 errors (breaking all Copilot CLI sessions when the agents are installed).

Changes:

  • Removed the trailing comma after the last element of the tools array in three agent files.
  • Ensured the tools arrays in these agents no longer parse into an extra empty entry.

Reviewed changes

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

File Description
agents/mentoring-juniors.agent.md Removes trailing comma after the last tools entry to avoid an empty parsed tool name.
agents/kusto-assistant.agent.md Removes trailing comma after the last tools entry to prevent invalid tool arrays.
agents/address-comments.agent.md Removes trailing comma after the last tools entry to avoid Copilot API 400 errors.

@aaronpowell aaronpowell merged commit 6446c1a into github:staged Apr 29, 2026
13 of 14 checks passed
fizznix pushed a commit to fizznix/awesome-copilot that referenced this pull request Apr 29, 2026
…ithub#1543)

Three agent files had a trailing comma after the last element in their
YAML flow-sequence tools arrays. When parsed, this produces an empty
string as an extra tool entry, which the Copilot API rejects with:

  CAPIError: 400 Invalid 'tools[N].function.name': empty string

Affected files:
- agents/kusto-assistant.agent.md
- agents/mentoring-juniors.agent.md
- agents/address-comments.agent.md

Co-authored-by: ilderaj <>
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.

3 participants