From 80a7504686fc4659e9e06052b227cdbc28e13f81 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Jul 2026 13:32:47 -0700 Subject: [PATCH] Cap clang-tidy agent runtime in build-warning-fixer workflow (#10327) The `agent` job in the Clang-Tidy Warning Fixer workflow was spending most of its runtime waiting on a full clang-tidy build, then failing before it could complete its safe-output path. This change narrows the prompt so the agent can make a bounded decision from early diagnostics instead of treating the full build as a prerequisite. - **Prompt guardrail** - Add a runtime-budget section to the compiled workflow prompt in `build-warning-fixer.lock.yml`. - Instruct the agent to stop after it has enough diagnostics for one safe fix, or after 15 minutes. - **Build scope reduction** - Switch initial diagnostic collection to a `shell`-only build. - Explicitly avoid waiting for a full `shell + test-z3` clang-tidy build before deciding whether to act. - **Fallback behavior** - Direct the agent to emit `noop` when it cannot reach a safe, validated fix within the time budget. - Keep `test-z3` optional unless it is already available or cheap to build within the remaining budget. Example of the new prompt guidance: ```yaml - Use `cmake --build build --target shell -- -k 0 2>&1 | tee /tmp/gh-aw/agent/clang-tidy-build.log` for initial diagnostic collection. - Do not wait for the full `shell` build to finish before deciding what to do. - Stop once you have enough diagnostics for one small, high-confidence fix, or after 15 minutes. - If no safe fix is ready in that budget, call `noop`. ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .github/workflows/build-warning-fixer.lock.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-warning-fixer.lock.yml b/.github/workflows/build-warning-fixer.lock.yml index 5d50311206..8e2e9b725b 100644 --- a/.github/workflows/build-warning-fixer.lock.yml +++ b/.github/workflows/build-warning-fixer.lock.yml @@ -302,6 +302,17 @@ jobs: cat << 'GH_AW_PROMPT_a12b000ae128b391_EOF' {{#runtime-import .github/workflows/build-warning-fixer.md}} + + ## Runtime guardrail + + The full `clang-tidy` build of both `shell` and `test-z3` is too large for this workflow's practical runtime budget. + This guardrail overrides the broader rebuild instructions above when they would keep you waiting on a long build. + + - Use `cmake --build build --target shell -- -k 0 2>&1 | tee /tmp/gh-aw/agent/clang-tidy-build.log` for initial diagnostic collection. + - Do **not** wait for the full `shell` build to finish before deciding what to do. + - Monitor `/tmp/gh-aw/agent/clang-tidy-build.log` and stop once you have enough diagnostics for one small, high-confidence fix, or after 15 minutes, whichever comes first. + - If you still do not have a safe, validated fix inside that budget, call `noop` with the diagnostics you found instead of continuing to wait. + - After a localized fix, rebuild `shell` and run a quick manual check such as `./build/z3 --version`; only build and run `test-z3` when the test binary is already available or can be built quickly within the remaining time budget. GH_AW_PROMPT_a12b000ae128b391_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates