Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/workflow/agent_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (c *Compiler) validateAgentFile(workflowData *WorkflowData, markdownPath st
if _, err := os.Stat(fullAgentPath); err != nil {
if os.IsNotExist(err) {
return formatCompilerError(markdownPath, "error",
fmt.Sprintf("agent file '%s' does not exist. Ensure the file exists in the repository and is properly imported.", agentPath), nil)
fmt.Sprintf("agent file '%s' does not exist. Check your workflow frontmatter: the 'agent:' field should reference a valid file path (e.g., '.github/agents/custom.agent.md')", agentPath), nil)
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

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

The error message refers to "the 'agent:' field" in the workflow frontmatter, but there is no top-level agent: frontmatter field. The AgentFile is actually populated through the imports: frontmatter field when a file under .github/agents/ is imported (see pkg/parser/import_bfs.go:180-198 and pkg/workflow/frontmatter_types.go:164). The engine.agent field in frontmatter (pkg/workflow/engine.go:206-212) is for specifying an agent identifier string, not a file path.

The message should reference the imports: field instead, and the example should show the imports syntax (e.g., imports: ['.github/agents/custom.agent.md']). The current wording will mislead users into looking for a non-existent agent: frontmatter key.

Suggested change
fmt.Sprintf("agent file '%s' does not exist. Check your workflow frontmatter: the 'agent:' field should reference a valid file path (e.g., '.github/agents/custom.agent.md')", agentPath), nil)
fmt.Sprintf("agent file '%s' does not exist. Check your workflow frontmatter: ensure the 'imports:' field includes a valid agent file path (for example: imports: ['.github/agents/custom.agent.md'])", agentPath), nil)

Copilot uses AI. Check for mistakes.
}
// Other error (permissions, etc.)
return formatCompilerError(markdownPath, "error",
Expand Down
Loading