3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-08-02 12:13:25 +00:00

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>
This commit is contained in:
Copilot 2026-07-31 13:32:47 -07:00 committed by GitHub
parent 784ca5eb38
commit 80a7504686
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -302,6 +302,17 @@ jobs:
cat << 'GH_AW_PROMPT_a12b000ae128b391_EOF'
</system>
{{#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