From d338f553c712d31ce5356782e45e3c61eada2417 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:34:54 +0000 Subject: [PATCH 1/3] Initial plan From 096071f45297b4b5e91ce13d4ef3623101dd6aab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:03:30 +0000 Subject: [PATCH 2/3] fix(skill-optimizer): add git stash, increase limits, add task scenarios (#28375) Agent-Logs-Url: https://github.com/github/gh-aw/sessions/98a63dc0-44e2-4cfc-a760-b161c56026cc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../workflows/daily-skill-optimizer.lock.yml | 39 ++++++++++++------- .github/workflows/daily-skill-optimizer.md | 15 ++++++- .skill-optimizer/skill-optimizer.json | 5 ++- .../task-ansi-escape-prevention.json | 12 ++++++ .../task-sanitized-outputs-migration.json | 12 ++++++ .../task-skill-optimizer-clean-git.json | 12 ++++++ 6 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 .skill-optimizer/task-ansi-escape-prevention.json create mode 100644 .skill-optimizer/task-sanitized-outputs-migration.json create mode 100644 .skill-optimizer/task-skill-optimizer-clean-git.json diff --git a/.github/workflows/daily-skill-optimizer.lock.yml b/.github/workflows/daily-skill-optimizer.lock.yml index b7c5315402f..077adefc8b8 100644 --- a/.github/workflows/daily-skill-optimizer.lock.yml +++ b/.github/workflows/daily-skill-optimizer.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"550699c424440a782f2664cc7c8ebf944402e57fd1229be37c90c9f9c705bd2a","strict":true,"agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"48f2c99e8092f8d6e53d9fbbb24cb9bd162bb7b61f6e636f05c30d5bc224b223","strict":true,"agent_id":"copilot"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","OPENROUTER_API_KEY"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/setup-node","sha":"53b83947a5a98c8d113130e565377fae1a50d02f","version":"v6.3.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.28","digest":"sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28","digest":"sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.28","digest":"sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.0"},{"image":"ghcr.io/github/github-mcp-server:v1.0.2"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) @@ -174,20 +174,20 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_1840c13ed866fb6d_EOF' + cat << 'GH_AW_PROMPT_f3a3ef046fe6c729_EOF' - GH_AW_PROMPT_1840c13ed866fb6d_EOF + GH_AW_PROMPT_f3a3ef046fe6c729_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_1840c13ed866fb6d_EOF' + cat << 'GH_AW_PROMPT_f3a3ef046fe6c729_EOF' Tools: create_issue, missing_tool, missing_data, noop - GH_AW_PROMPT_1840c13ed866fb6d_EOF + GH_AW_PROMPT_f3a3ef046fe6c729_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" - cat << 'GH_AW_PROMPT_1840c13ed866fb6d_EOF' + cat << 'GH_AW_PROMPT_f3a3ef046fe6c729_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -216,12 +216,12 @@ jobs: {{/if}} - GH_AW_PROMPT_1840c13ed866fb6d_EOF + GH_AW_PROMPT_f3a3ef046fe6c729_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_1840c13ed866fb6d_EOF' + cat << 'GH_AW_PROMPT_f3a3ef046fe6c729_EOF' {{#runtime-import .github/workflows/daily-skill-optimizer.md}} - GH_AW_PROMPT_1840c13ed866fb6d_EOF + GH_AW_PROMPT_f3a3ef046fe6c729_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 @@ -411,9 +411,9 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_6045609e54783901_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_e36b3fbcbf004603_EOF' {"create_issue":{"expires":168,"labels":["automation","documentation","prompt-quality"],"max":1,"title_prefix":"[skill-optimizer] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_6045609e54783901_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_e36b3fbcbf004603_EOF - name: Write Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -612,7 +612,7 @@ jobs: mkdir -p /home/runner/.copilot GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_7c2b4fa6007aa509_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_f1477e2596f04e30_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { @@ -653,7 +653,7 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_7c2b4fa6007aa509_EOF + GH_AW_MCP_CONFIG_f1477e2596f04e30_EOF - name: Mount MCP servers as CLIs id: mount-mcp-clis continue-on-error: true @@ -1315,6 +1315,10 @@ jobs: exit 1 fi shell: bash + - name: Stash any uncommitted changes + run: | + git stash --include-untracked || true + shell: bash - name: Run skill-optimizer id: run_skill_optimizer run: | @@ -1338,8 +1342,8 @@ jobs: "models": [ "openrouter/anthropic/claude-sonnet-4.6" ], - "maxTasks": 10, - "maxIterations": 1 + "maxTasks": 20, + "maxIterations": 3 } EOF @@ -1385,6 +1389,11 @@ jobs: env: OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} shell: bash + - name: Restore stashed changes + if: always() + run: | + git stash pop || true + shell: bash - name: Upload skill-optimizer artifact if: always() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/.github/workflows/daily-skill-optimizer.md b/.github/workflows/daily-skill-optimizer.md index ca58ccdc7d3..0166bcb7880 100644 --- a/.github/workflows/daily-skill-optimizer.md +++ b/.github/workflows/daily-skill-optimizer.md @@ -42,6 +42,11 @@ jobs: exit 1 fi + - name: Stash any uncommitted changes + shell: bash + run: | + git stash --include-untracked || true + - name: Run skill-optimizer id: run_skill_optimizer shell: bash @@ -68,8 +73,8 @@ jobs: "models": [ "openrouter/anthropic/claude-sonnet-4.6" ], - "maxTasks": 10, - "maxIterations": 1 + "maxTasks": 20, + "maxIterations": 3 } EOF @@ -113,6 +118,12 @@ jobs: echo "run_mode=$RUN_MODE" >> "$GITHUB_OUTPUT" echo "run_status=$RUN_STATUS" >> "$GITHUB_OUTPUT" + - name: Restore stashed changes + if: always() + shell: bash + run: | + git stash pop || true + - name: Upload skill-optimizer artifact if: always() uses: actions/upload-artifact@v7.0.1 diff --git a/.skill-optimizer/skill-optimizer.json b/.skill-optimizer/skill-optimizer.json index 5f6e4c6b7cc..478a018c9dc 100644 --- a/.skill-optimizer/skill-optimizer.json +++ b/.skill-optimizer/skill-optimizer.json @@ -10,7 +10,7 @@ "timeout": 240000, "taskGeneration": { "enabled": true, - "maxTasks": 10, + "maxTasks": 20, "outputDir": "." }, "models": [ @@ -32,6 +32,7 @@ "model": "openrouter/anthropic/claude-sonnet-4.6", "allowedPaths": ["SKILL.md"], "validation": [], - "maxIterations": 1 + "maxIterations": 3, + "requireCleanGit": false } } diff --git a/.skill-optimizer/task-ansi-escape-prevention.json b/.skill-optimizer/task-ansi-escape-prevention.json new file mode 100644 index 00000000000..c23acbe9ca7 --- /dev/null +++ b/.skill-optimizer/task-ansi-escape-prevention.json @@ -0,0 +1,12 @@ +{ + "id": "ansi-escape-prevention", + "input": "I'm editing a compiled workflow YAML file in .github/workflows/ and some terminal output I pasted seems to have broken the YAML parser. How do I avoid ANSI escape codes in workflow YAML files, and how do I check for them?", + "ideal": "ANSI escape codes (e.g. \\x1b[31m, \\x1b[0m) are terminal color codes that break YAML parsing. To avoid them: (1) never copy-paste from colored terminal output into YAML files; use --no-color flags or pipe through `| cat` to strip colors before saving; (2) run `make recompile` to regenerate clean .lock.yml files from .md sources—the workflow compiler automatically strips ANSI codes during compilation via stringutil.StripANSI(); (3) detect existing ANSI codes with: `find .github/workflows -name '*.yml' -o -name '*.yaml' | xargs grep -P '\\x1b\\[[0-9;]*[a-zA-Z]'`; (4) after fixing the source .md file, always run `make recompile` rather than hand-editing .lock.yml files.", + "criteria": [ + "Mentions that ANSI escape codes break YAML parsing", + "Recommends using --no-color or piping through `| cat` when generating terminal output", + "Mentions `make recompile` to regenerate clean workflow files", + "Notes that the compiler automatically strips ANSI codes", + "Provides a command to detect ANSI codes in YAML files" + ] +} diff --git a/.skill-optimizer/task-sanitized-outputs-migration.json b/.skill-optimizer/task-sanitized-outputs-migration.json new file mode 100644 index 00000000000..2912cefe420 --- /dev/null +++ b/.skill-optimizer/task-sanitized-outputs-migration.json @@ -0,0 +1,12 @@ +{ + "id": "sanitized-outputs-migration", + "input": "I have a workflow that uses `${{ needs.activation.outputs.text }}` and `${{ needs.activation.outputs.title }}` in the agent prompt to get the issue body and title. I'm seeing a deprecation warning during compilation. What should I change, and why?", + "ideal": "Replace `needs.activation.outputs.text`, `needs.activation.outputs.title`, and `needs.activation.outputs.body` with `steps.sanitized.outputs.text`, `steps.sanitized.outputs.title`, and `steps.sanitized.outputs.body` respectively. The reason: the agent prompt is generated inside the activation job itself, and a job cannot reference its own needs outputs via `needs.activation.outputs.*` in GitHub Actions. The `sanitized` step within the activation job computes sanitized versions of the triggering content and exposes them as `steps.sanitized.outputs.*`. The compiler still accepts the old form and auto-rewrites it (emitting a deprecation warning), but you should use `steps.sanitized.outputs.*` directly in all new and updated workflows. Note: only `text`, `title`, and `body` are affected—continue using `needs.activation.outputs.*` for other outputs like `comment_id`, `comment_repo`, and `slash_command` in downstream jobs.", + "criteria": [ + "Identifies the correct replacement: steps.sanitized.outputs.text/title/body", + "Explains why needs.activation.outputs.* doesn't work inside the activation job", + "Mentions that the compiler auto-rewrites the old form with a deprecation warning", + "Notes that only text, title, body are affected (not comment_id, slash_command, etc.)", + "Clarifies that needs.activation.outputs.* still works in downstream jobs" + ] +} diff --git a/.skill-optimizer/task-skill-optimizer-clean-git.json b/.skill-optimizer/task-skill-optimizer-clean-git.json new file mode 100644 index 00000000000..b1f0f779807 --- /dev/null +++ b/.skill-optimizer/task-skill-optimizer-clean-git.json @@ -0,0 +1,12 @@ +{ + "id": "skill-optimizer-clean-git", + "input": "Our daily skill-optimizer CI job keeps failing with the error: `target.repoPath: target repo has uncommitted changes (optimize.requireCleanGit is enabled)`. The init step runs fine but the run step fails every time. How should I fix this so the optimizer can run successfully in CI?", + "ideal": "There are two complementary fixes: (1) Set `\"requireCleanGit\": false` in the `optimize` section of `.skill-optimizer/skill-optimizer.json`—this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous `make recompile` or `init` step that modifies config files). (2) In the workflow YAML, add a `git stash --include-untracked` step before invoking the optimizer and a corresponding `git stash pop` step (with `if: always()`) after the run to restore any stashed changes. Using `requireCleanGit: false` is the simplest fix for CI environments where the checkout is ephemeral; adding the stash step is a belt-and-suspenders approach that also works if the flag is not available in your version of the tool.", + "criteria": [ + "Identifies setting requireCleanGit: false in .skill-optimizer/skill-optimizer.json as a fix", + "Mentions the optimize section of the config file", + "Suggests git stash --include-untracked before the optimizer run", + "Mentions git stash pop (with always() condition) to restore changes afterward", + "Explains that uncommitted changes can come from init or recompile steps" + ] +} From 4b2dc15dea0b1b3fcd5bd5e8edc66d104a0afb72 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:07:25 +0000 Subject: [PATCH 3/3] fix(skill-optimizer): remove escaped quotes from task ideal field Agent-Logs-Url: https://github.com/github/gh-aw/sessions/98a63dc0-44e2-4cfc-a760-b161c56026cc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .skill-optimizer/task-skill-optimizer-clean-git.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.skill-optimizer/task-skill-optimizer-clean-git.json b/.skill-optimizer/task-skill-optimizer-clean-git.json index b1f0f779807..156d0fff901 100644 --- a/.skill-optimizer/task-skill-optimizer-clean-git.json +++ b/.skill-optimizer/task-skill-optimizer-clean-git.json @@ -1,7 +1,7 @@ { "id": "skill-optimizer-clean-git", "input": "Our daily skill-optimizer CI job keeps failing with the error: `target.repoPath: target repo has uncommitted changes (optimize.requireCleanGit is enabled)`. The init step runs fine but the run step fails every time. How should I fix this so the optimizer can run successfully in CI?", - "ideal": "There are two complementary fixes: (1) Set `\"requireCleanGit\": false` in the `optimize` section of `.skill-optimizer/skill-optimizer.json`—this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous `make recompile` or `init` step that modifies config files). (2) In the workflow YAML, add a `git stash --include-untracked` step before invoking the optimizer and a corresponding `git stash pop` step (with `if: always()`) after the run to restore any stashed changes. Using `requireCleanGit: false` is the simplest fix for CI environments where the checkout is ephemeral; adding the stash step is a belt-and-suspenders approach that also works if the flag is not available in your version of the tool.", + "ideal": "There are two complementary fixes: (1) Add requireCleanGit set to false in the optimize section of .skill-optimizer/skill-optimizer.json — this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous make recompile or init step that modifies config files). (2) In the workflow YAML, add a git stash --include-untracked step before invoking the optimizer and a corresponding git stash pop step (with if: always()) after the run to restore any stashed changes. Using requireCleanGit: false is the simplest fix for CI environments where the checkout is ephemeral; adding the stash step is a belt-and-suspenders approach that also works if the flag is not available in your version of the tool.", "criteria": [ "Identifies setting requireCleanGit: false in .skill-optimizer/skill-optimizer.json as a fix", "Mentions the optimize section of the config file",