How can skills that include scripts work in an agent plugin? #190400
-
Select Topic AreaBug Copilot Feature AreaCopilot Agent Mode BodyI am writing some agent plugins that include skills that have a scripts folder (with some scripts the agent skill can run). Maybe I just don't understand how this is supposed to work, but it seems to me that scripts should be relative to the skill that owns them. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
This is a classic execution context headache with Copilot Extensions. You’re right that the agent defaults to the workspace root for any terminal command it tries to run, which completely breaks local scripts tucked away in a plugin folder. The best way to handle this isn't to rely on the agent to "figure out" the path, but to resolve the absolute path within your plugin logic before the command ever hits the agent. If you’re building the plugin in Node, you should use Basically, think of the agent as a user who is always Hope that helps! If it solves the problem, feel free to mark this as the answer. It helps other people with the same issue find the fix faster. jannoguer |
Beta Was this translation helpful? Give feedback.
This is a classic execution context headache with Copilot Extensions. You’re right that the agent defaults to the workspace root for any terminal command it tries to run, which completely breaks local scripts tucked away in a plugin folder.
The best way to handle this isn't to rely on the agent to "figure out" the path, but to resolve the absolute path within your plugin logic before the command ever hits the agent.
If you’re building the plugin in Node, you should use
path.resolveor__dirnameto point to your scripts folder specifically. When your skill tells the agent, "Run this script," it should be passing the full, absolute path (e.g.,/Users/name/.vscode/extensions/your-plugin/scri…