-
Notifications
You must be signed in to change notification settings - Fork 277
fix: local .github/agents imports now use snippet-style runtime-import path for Claude/Codex #19614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,16 +219,21 @@ func (e *ClaudeEngine) GetExecutionSteps(workflowData *WorkflowData, logFile str | |
| } | ||
|
|
||
| // Build the agent command - prepend custom agent file content if specified (via imports) | ||
| // Note: AgentFile is only set for remote agent imports. Local agent imports use the | ||
| // runtime-import macro path (snippet-style) and do not set AgentFile. | ||
| // The AGENT_CONTENT approach reads the file at runtime from $GITHUB_WORKSPACE; it is only | ||
| // appropriate for remote imports where the file has been checked out separately. | ||
| var promptSetup string | ||
| var promptCommand string | ||
| if workflowData.AgentFile != "" { | ||
| agentPath := ResolveAgentFilePath(workflowData.AgentFile) | ||
| claudeLog.Printf("Using custom agent file: %s", workflowData.AgentFile) | ||
| // Extract markdown body from custom agent file and prepend to prompt | ||
| // Extract markdown body from custom agent file (skip YAML frontmatter) and prepend to prompt. | ||
| promptSetup = fmt.Sprintf(`# Extract markdown body from custom agent file (skip frontmatter) | ||
| AGENT_CONTENT="$(awk 'BEGIN{skip=1} /^---$/{if(skip){skip=0;next}else{skip=1;next}} !skip' %s)" | ||
| %s | ||
| # Combine agent content with prompt | ||
| PROMPT_TEXT="$(printf '%%s\n\n%%s' "$AGENT_CONTENT" "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)")"`, agentPath) | ||
| PROMPT_TEXT="$(printf '%%s\n\n%%s' "$AGENT_CONTENT" "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)")"`, | ||
| AgentFileBodyExtractCmd(agentPath)) | ||
| promptCommand = "\"$PROMPT_TEXT\"" | ||
|
Comment on lines
221
to
237
|
||
| } else { | ||
| promptCommand = "\"$(cat /tmp/gh-aw/aw-prompts/prompt.txt)\"" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
item.fullPathis an OS-native path (uses\on Windows). The agent-file detectionstrings.Contains(item.fullPath, "/.github/agents/")will fail on Windows and cause agent imports to be treated as regular imports. Consider reusing the existingisCustomAgentFile()helper (it normalizes viafilepath.ToSlash) or normalizeitem.fullPathbefore this check.This issue also appears on line 188 of the same file.