Add compiler check: verify all registered safe-outputs are present in tools JSON - #17251
Conversation
…JSON Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a compiler-time validation check to ensure all registered safe-output types have corresponding tool definitions in the static safe-output-tools.json file, preventing silent failures where tools are registered in Go code but missing from the JSON payload.
Changes:
- Added
checkAllEnabledToolsPresenthelper function to validate that all enabled tools (excluding dynamically-generated ones) are present in the static tools JSON - Integrated the check into
generateFilteredToolsJSONbefore dynamic tool generation - Added comprehensive unit tests for the validation function and a regression test to verify standard outputs
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_tools_generation.go | Implements the validation check to detect missing tool definitions |
| pkg/workflow/safe_outputs_tools_generation_test.go | Adds unit tests for the validation function and regression tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Add @copilot, merge |
Done in 84b2d39 — merged Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
checkAllEnabledToolsPresenthelper function that verifies all registered safe-outputs appear in the filtered tools list (excluding dispatch-workflows and custom jobs, which are handled dynamically)generateFilteredToolsJSONafter the static tool filtering loop but before adding dynamic tools (custom jobs + dispatch workflows)TestGenerateFilteredToolsJSONWithStandardOutputsverifying standard outputs produce expected toolsorigin/main, rebuild binary, recompile all 153 lock filesOriginal 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.