Fix agent identifier extraction for .agent.md and .agent files#5790
Merged
Fix agent identifier extraction for .agent.md and .agent files#5790
Conversation
Contributor
|
@copilot trim .agent from agent name |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Update ExtractAgentIdentifier to strip both .agent.md and .md extensions. This fixes the issue where custom agent files like "speckit-dispatcher.agent.md" were being converted to "speckit-dispatcher.agent" instead of "speckit-dispatcher" when passed to Copilot CLI's --agent flag. - Updated ExtractAgentIdentifier to try .agent.md first, then .md - Added 4 test cases for .agent.md filename pattern - All tests pass including agent import tests - Manually verified speckit-dispatcher workflow compiles correctly Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Recompiled all workflows to apply the agent identifier fix. Agent identifiers in compiled workflows now correctly use: - speckit-dispatcher (was speckit-dispatcher.agent) - technical-doc-writer (was technical-doc-writer.agent) All tests pass and make agent-finish completes successfully. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing agent in speckit-dispatcher
Fix agent identifier extraction for .agent.md files
Dec 7, 2025
Extended ExtractAgentIdentifier to also trim .agent extension (without .md). This makes the function more robust and handles edge cases where agent files might use .agent extension alone. - Added trimming of .agent suffix after .agent.md and .md - Added 2 test cases for .agent extension handling - All tests pass including agent import tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Fix agent identifier extraction for .agent.md files
Fix agent identifier extraction for .agent.md and .agent files
Dec 7, 2025
This was referenced Dec 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom agent files using
.agent.mdextension were generating incorrect agent identifiers.speckit-dispatcher.agent.mdbecamespeckit-dispatcher.agentinstead ofspeckit-dispatcher, causing Copilot CLI to fail with "No such agent" errors.Changes
pkg/workflow/engine_helpers.go: ModifiedExtractAgentIdentifierto strip.agent.md,.md, and.agentsuffixes in orderpkg/workflow/engine_helpers_test.go: Added test coverage for.agent.mdand.agentfilename patternsExample
The fix maintains backward compatibility with existing
.mdagent files while properly handling the.agent.mdnaming convention used by custom agents, and also supports.agentextension for edge cases.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.