feat: load safe_outputs_tools.json from actions/setup at runtime instead of inlining#21323
feat: load safe_outputs_tools.json from actions/setup at runtime instead of inlining#21323
Conversation
…sing tools_meta.json Instead of inlining the entire filtered safe_outputs_tools.json content as a heredoc in each compiled workflow YAML, generate a small tools_meta.json at compile time and use a new JavaScript script to assemble the final tools.json at runtime by loading from the actions/setup folder. Changes: - Add generate_safe_outputs_tools.cjs: reads safe_outputs_tools.json from the actions folder, applies description suffixes and repo params from tools_meta.json, appends dynamic tools, and writes the final tools.json - Add generate_safe_outputs_tools.test.cjs: 10 unit tests for the new script - Add computeEnabledToolNames, computeRepoParamForTool, generateDynamicTools, ToolsMeta struct, and generateToolsMetaJSON to safe_outputs_tools_filtering.go - Modify mcp_setup_generator.go to write tools_meta.json (small) and run the JS script instead of inlining the large filtered tools.json heredoc - Recompile all 172 lock files with the new format (significant size reduction) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add more integration tests covering the older behavior compared to new rendered tools.json. Make sure custom descriptions are working. |
…lder behavior and custom descriptions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added
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:
|
There was a problem hiding this comment.
Pull request overview
This PR reduces workflow lockfile bloat by replacing compile-time inlining of safe_outputs_tools.json with runtime generation of the final tools.json from a small per-workflow tools_meta.json.
Changes:
- Generate
tools_meta.jsonduring compilation and invoke a runtime Node script to assemble the finaltools.json. - Add
actions/setup/js/generate_safe_outputs_tools.cjsto load, filter, and enhance tool definitions at runtime. - Regenerate workflow lockfiles to write
tools_meta.json(instead of largetools.json) and run the runtime generator.
Reviewed changes
Copilot reviewed 101 out of 171 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/mcp_setup_generator.go | Switches from generating inlined tools.json to emitting tools_meta.json + running a Node generator at runtime |
| actions/setup/js/generate_safe_outputs_tools.cjs | New runtime generator that loads source tools, filters by config, applies meta overrides, and writes tools.json |
| .github/workflows/typist.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/test-dispatcher.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/test-create-pr-error-handling.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/terminal-stylist.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/static-analysis-report.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/smoke-call-workflow.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/slide-deck-maintainer.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/sergo.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/schema-consistency-checker.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/safe-output-health.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/research.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/repository-quality-improver.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/repo-tree-map.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/repo-audit-analyzer.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/release.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/prompt-clustering-analysis.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/notion-issue-summary.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/mergefest.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/lockfile-stats.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/hourly-ci-cleaner.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/go-fan.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/github-remote-mcp-auth-test.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/firewall-escape.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/example-workflow-analyzer.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/duplicate-code-detector.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/dev.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/daily-team-evolution-insights.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/daily-semgrep-scan.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/daily-malicious-code-scan.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/daily-compiler-quality.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/daily-choice-test.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/copilot-pr-prompt-analysis.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/copilot-pr-merged-report.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/copilot-cli-deep-research.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/copilot-agent-analysis.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/constraint-solving-potd.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/commit-changes-analyzer.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/claude-code-user-docs-review.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/ci-coach.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/breaking-change-checker.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/blog-auditor.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/artifacts-summary.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
| .github/workflows/agent-persona-explorer.lock.yml | Replaces inlined tools.json with tools_meta.json and runs runtime generator |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...] |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
❌ Tool validation failed! Agent Container Smoke Test detected missing tools: failed |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
…in lock files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 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:
|
|
💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...] |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
❌ Tool validation failed! Agent Container Smoke Test detected missing tools: failed |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
…/actions in generate_safe_outputs_tools.cjs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready. |
|
💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...] |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
Agent Container Tool Check
Result: 12/12 tools available ✅ — PASS
|
|
Commit pushed:
|
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
Each compiled
.lock.ymlwas embedding a 20–50 KB filtered copy ofsafe_outputs_tools.jsonas a heredoc, bloating every lock file and forcing a full recompile of all 172 workflows whenever tool descriptions changed.Strategy
Before: Go filters + enhances
safe_outputs_tools.jsonat compile time → entire JSON inlined as heredoc in every lock file.After: Compile time produces a small
tools_meta.json(~10 lines); runtime JS loads the source file from theactions/setupfolder and assembles the finaltools.json.Changes
actions/setup/js/generate_safe_outputs_tools.cjs— new runtime script: readssafe_outputs_tools.jsonfrom/tmp/gh-aw/actions/, filters tools whose names appear as keys inconfig.json, applies description suffixes and repo params fromtools_meta.json, appends dynamic tools, writes finaltools.jsonactions/setup/js/generate_safe_outputs_tools.test.cjs— 10 unit tests covering filtering, description enhancement, repo params, dynamic tool merging, and error pathspkg/workflow/safe_outputs_tools_filtering.go— addsgenerateToolsMetaJSON(producestools_meta.jsoncontent) and extracted helpers:computeEnabledToolNames,computeRepoParamForTool,generateDynamicTools,ToolsMetapkg/workflow/mcp_setup_generator.go— replacesgenerateFilteredToolsJSON+ large heredoc withgenerateToolsMetaJSON+nodeinvocationpkg/workflow/safe_outputs_tools_meta_integration_test.go— 8 integration tests verifying behavioral equivalence between the old and new approaches, including:tools_meta.jsonmatch the constraint text previously embedded directly in tool descriptions bygenerateFilteredToolsJSONdynamic_tools)Result
172 lock files regenerated; net 28,738 lines removed. Tool description changes no longer require recompiling all workflows.
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.