From a4fc805f67b3e6167b78c13a71405e125edbe4da Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Wed, 5 Aug 2026 01:43:21 +0000 Subject: [PATCH] agents(monitor-ci-results): autonomous flake retries via subagent and forbid file lists in PRs When monitoring CI, include the specific PR number in process greps to avoid matching monitors for other PRs. Additionally, when a CI failure is confirmed as a transient infrastructure flake, autonomously spawn a subagent to invoke the buildkite-retry-job skill using a prompt template rather than executing scripts directly. Finally, forbid manual lists of modified files in PR descriptions. --- .agents/skills/monitor-ci-results/SKILL.md | 15 +++++++++++++-- .../skills/monitor-ci-results/retry-job-prompt.md | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .agents/skills/monitor-ci-results/retry-job-prompt.md diff --git a/.agents/skills/monitor-ci-results/SKILL.md b/.agents/skills/monitor-ci-results/SKILL.md index 3a1fab866b..e2475b55ad 100644 --- a/.agents/skills/monitor-ci-results/SKILL.md +++ b/.agents/skills/monitor-ci-results/SKILL.md @@ -12,8 +12,10 @@ or when monitoring CI after PR updates: > launch duplicate monitoring jobs for the same PR. 1. **Check Existing Process**: Check if a monitor script is already running for - the PR (e.g., `pgrep -f "monitor_remote_ci.py "`). If one is - already running, do not start another instance. + **this specific PR** using `pgrep -f "monitor_remote_ci.py "`. Do + NOT use a generic grep without ``, as other active agent + conversations may be monitoring different PRs concurrently. If one is + already running for this PR, do not start another instance. 2. **Launch Monitoring Script**: If no monitor process is active for ``, launch the script in the background: ```bash @@ -35,3 +37,12 @@ or when monitoring CI after PR updates: the monitoring script, immediately launch a separate subagent using the `invoke_subagent` tool with the role "CI Failure Analyzer" to run the `analyze-ci-failure` skill on the reported failure. +5. **Autonomous Flake Retry**: If the CI Failure Analyzer subagent confirms + that the failure is a transient infrastructure or network flake (e.g. disk + I/O error, 504 gateway, sandbox initialization failure), **immediately and + autonomously** launch a separate subagent using `invoke_subagent` with the + role "CI Job Retrier" and the prompt template in + `.agents/skills/monitor-ci-results/retry-job-prompt.md` to run the + `buildkite-retry-job` skill for ``. Do not execute the script + directly; use the subagent and skill orchestration instead. Continue + monitoring without pausing to ask the user. diff --git a/.agents/skills/monitor-ci-results/retry-job-prompt.md b/.agents/skills/monitor-ci-results/retry-job-prompt.md new file mode 100644 index 0000000000..4d2edad650 --- /dev/null +++ b/.agents/skills/monitor-ci-results/retry-job-prompt.md @@ -0,0 +1,3 @@ +Use the `buildkite-retry-job` skill to retry the failed Buildkite job(s) for PR {pr_number}. +Follow the instructions in `.agents/skills/buildkite-retry-job/SKILL.md` to retry the failing jobs using the skill. +Once the retry request completes, report back to the parent conversation.