-
Notifications
You must be signed in to change notification settings - Fork 37
Add engine-specific custom instructions to agentic prompts #12026
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
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| // GetCustomInstructions returns Copilot-specific instructions to be added to the prompt | ||
| func (e *CopilotEngine) GetCustomInstructions() string { | ||
| return `<agent_cli_authentication> | ||
| **CRITICAL**: The gh CLI is NOT authenticated in this workflow environment. Do NOT attempt to use gh commands for GitHub API operations. |
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.
@copilot did you mean copilot instead of gh?
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.
The warning is correct - it refers to the gh CLI (GitHub CLI at https://cli.github.com/), not the copilot CLI.
The issue is that agents might try to use gh commands like gh issue create or gh pr create for GitHub operations, but the gh CLI is not authenticated in workflow environments. Instead, agents should use the safe-output tools provided by the workflow system.
The copilot CLI (the agentic engine itself) is properly authenticated via COPILOT_GITHUB_TOKEN - this warning is specifically about preventing agents from attempting to use gh commands.
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.
@copilot WRONG! the copilot cli running from bash in the agent is NOT authenticated. There is already a prompt for gh in another file. Focus on the agent cli itself only.
Do this for Claude and codex.
Use file template in actions/setup with the other prompts
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Agents were attempting to use
ghCLI commands for GitHub operations despite the CLI not being authenticated in workflow environments.Changes
New interface: Added
PromptCustomizerinterface to engine architecture withGetCustomInstructions()methodCodingAgentEngineinterface for all enginesBaseEnginereturns empty string (optional)Engine implementations: All engines (copilot, claude, codex, custom) now inject authentication warning into prompts:
Prompt pipeline: Updated
collectPromptSections()andgeneratePrompt()to:<system>section after temp folder/markdown instructionsInstructions appear in all compiled
.lock.ymlworkflows and are visible to agentic execution contexts.Original prompt
💡 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.