From b05378d1c3da142ddf5cfa63e04bf0f903e62cd1 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sun, 15 Nov 2026 03:48:26 -0400 Subject: [PATCH 1/2] pr-agent: wait (bounded) for a coder-llm gpu-hold window; skip, never pass, when no window opens The PR-Agent model (coder-llm, Qwen3-Coder-30B on HRX) moves into gpu-hold tickets (engine#2494, #2496). A reviewer job asks for a window (demand file) and waits up to 25 min for a real one-token answer; pr_agent runs only when it got one, keeps the window open while it works, and is skipped with 'reviewer unavailable' in the summary otherwise. The trusted-actor filter moves to the reviewer job unchanged. Patch prepared by cl-infra (~/briefs/CODER-LLM-TICKETED-pr-agent-workflow.patch); pushed by the orchestrator because lane tokens lack the workflow scope. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pr-agent.yml | 53 ++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr-agent.yml b/.github/workflows/pr-agent.yml index 013a9f52b..46e9259ff 100644 --- a/.github/workflows/pr-agent.yml +++ b/.github/workflows/pr-agent.yml @@ -34,7 +34,39 @@ permissions: contents: read jobs: + # The model runs only inside a gpu-hold ticket, in on-demand windows (engine#2494, docs/ci-runners.md): this job asks + # for a window and waits for it, bounded. If the model never answers, pr_agent below is SKIPPED, shown as skipped, + # with "reviewer unavailable" in this job's summary - never a review that did not happen reported as a pass. + reviewer: + runs-on: [self-hosted, pr-agent] + if: | + (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || + (github.event_name == 'issue_comment' && github.event.issue.pull_request && + contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) + timeout-minutes: 30 + outputs: + available: ${{ steps.wait.outputs.available }} + steps: + - name: Wait for the local model (coder-llm, a gpu-hold window) + id: wait + run: | + demand="$HOME/.cache/coder-llm/demand"; mkdir -p "$(dirname "$demand")" + # a real one-token completion, not just /v1/models: the server answers that before the model is loaded + deadline=$(( $(date +%s) + 25 * 60 )) + while [ "$(date +%s)" -lt "$deadline" ]; do + touch "$demand" + if curl -sf --max-time 60 http://127.0.0.1:8090/v1/chat/completions -H 'Content-Type: application/json' \ + -d '{"model":"qwen3-coder","messages":[{"role":"user","content":"ok"}],"max_tokens":1}' > /dev/null; then + echo "available=true" >> "$GITHUB_OUTPUT"; exit 0 + fi + sleep 15 + done + echo "available=false" >> "$GITHUB_OUTPUT" + echo "::warning::reviewer unavailable: the local model (coder-llm, :8090) did not answer within 25 min; no review was run" + echo "### reviewer unavailable: no GPU window for the local model within 25 min; pr_agent is skipped, not passed" >> "$GITHUB_STEP_SUMMARY" + pr_agent: + needs: reviewer runs-on: [self-hosted, pr-agent] # on the job, not the workflow: a comment that skips the job (a bot's, say) must not cancel a review concurrency: @@ -46,11 +78,8 @@ jobs: group: pr-agent-${{ github.event.pull_request.number || github.event.issue.number }}-${{ github.event_name }} cancel-in-progress: true timeout-minutes: 30 - # same-repo PRs, and comments by the owner, members or collaborators on a pull request - if: | - (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || - (github.event_name == 'issue_comment' && github.event.issue.pull_request && - contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) + # only when the reviewer job got a model answer (the same-repo / trusted-comment filter is on that job) + if: needs.reviewer.outputs.available == 'true' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: PR-Agent @@ -75,16 +104,10 @@ jobs: python3 -m venv "$venv" "$venv/bin/pip" install -q "pr-agent[github]==$PRA_VERSION" fi - # a real one-token completion, not just /v1/models: the server answers that before the model is loaded - ready=0 - for i in $(seq 1 30); do - if curl -sf --max-time 60 http://127.0.0.1:8090/v1/chat/completions -H 'Content-Type: application/json' \ - -d '{"model":"qwen3-coder","messages":[{"role":"user","content":"ok"}],"max_tokens":1}' > /dev/null; then - ready=1; break - fi - sleep 10 - done - [ "$ready" = 1 ] || { echo "::error::the local model (coder-llm on :8090) does not answer"; exit 1; } + # keep the gpu-hold window open while this job works: the window closes after 5 idle minutes without demand + demand="$HOME/.cache/coder-llm/demand" + ( while :; do touch "$demand"; sleep 60; done ) & toucher=$! + trap 'kill $toucher 2> /dev/null' EXIT # PR-Agent exits 0 even when every model call failed or the command never ran, so check its log run() { pr-agent --pr_url "$pr" "$@" 2>&1 | tee "$RUNNER_TEMP/pr-agent.log" From df572af695faffea6c3b4d3a8a165509f64c50a4 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sun, 15 Nov 2026 04:48:08 -0400 Subject: [PATCH 2/2] pr-agent: no window -> the reviewer job FAILS ('reviewer unavailable'), wait cut to 10 min Review of #2509: a skipped job counts as success for a required check, so 'no window' could merge an unreviewed PR green; and a 25-minute wait held the single pr-agent runner. Now the reviewer job fails, visibly, after 10 min (job timeout 15), with a re-run hint; pr_agent still runs only on a real answer. Patch v2 by cl-infra; pushed by the orchestrator (workflow scope). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pr-agent.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-agent.yml b/.github/workflows/pr-agent.yml index 46e9259ff..b821cf19c 100644 --- a/.github/workflows/pr-agent.yml +++ b/.github/workflows/pr-agent.yml @@ -35,15 +35,16 @@ permissions: jobs: # The model runs only inside a gpu-hold ticket, in on-demand windows (engine#2494, docs/ci-runners.md): this job asks - # for a window and waits for it, bounded. If the model never answers, pr_agent below is SKIPPED, shown as skipped, - # with "reviewer unavailable" in this job's summary - never a review that did not happen reported as a pass. + # for a window and waits for it, bounded at 10 min so the single pr-agent runner is not held for long. If the model + # never answers, THIS job FAILS with "reviewer unavailable" (a skipped job would count as a pass for a required check, + # so "no review" must be visible as a red reviewer, never as green), and pr_agent below does not run. reviewer: runs-on: [self-hosted, pr-agent] if: | (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) - timeout-minutes: 30 + timeout-minutes: 15 outputs: available: ${{ steps.wait.outputs.available }} steps: @@ -52,7 +53,7 @@ jobs: run: | demand="$HOME/.cache/coder-llm/demand"; mkdir -p "$(dirname "$demand")" # a real one-token completion, not just /v1/models: the server answers that before the model is loaded - deadline=$(( $(date +%s) + 25 * 60 )) + deadline=$(( $(date +%s) + 10 * 60 )) while [ "$(date +%s)" -lt "$deadline" ]; do touch "$demand" if curl -sf --max-time 60 http://127.0.0.1:8090/v1/chat/completions -H 'Content-Type: application/json' \ @@ -62,8 +63,9 @@ jobs: sleep 15 done echo "available=false" >> "$GITHUB_OUTPUT" - echo "::warning::reviewer unavailable: the local model (coder-llm, :8090) did not answer within 25 min; no review was run" - echo "### reviewer unavailable: no GPU window for the local model within 25 min; pr_agent is skipped, not passed" >> "$GITHUB_STEP_SUMMARY" + echo "### reviewer unavailable: no GPU window for the local model (coder-llm, :8090) within 10 min; no review was run" >> "$GITHUB_STEP_SUMMARY" + echo "::error::reviewer unavailable: the local model (coder-llm, :8090) did not answer within 10 min; no review was run (re-run this job to retry)" + exit 1 pr_agent: needs: reviewer