From c308c1ea7565a88fd98a6cbc8a2e04105f7089d0 Mon Sep 17 00:00:00 2001 From: Shay Palachy Date: Thu, 30 Apr 2026 06:45:06 +0300 Subject: [PATCH 1/2] Fix pr-agent-context refresh fallback wiring --- .agent-plan.md | 2 +- .../pr-agent-context-refresh-dispatcher.yml | 2 + .../workflows/pr-agent-context-refresh.yml | 45 ++++++++++++++++--- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/.agent-plan.md b/.agent-plan.md index e6210b1..a759000 100644 --- a/.agent-plan.md +++ b/.agent-plan.md @@ -6,7 +6,7 @@ ## Current System State -**v0.5.0 in progress — Milestones 7–11 complete, v4 dataset shipped.** Full simulation engine + render/bundle + exposure filtering + CLI commands + validation harness implemented. v4 engine changes + build pipeline merged (PR #21). v4 dataset generated and validated. 609 tests passing. +**v0.5.0 in progress — Milestones 7–11 complete, v4 dataset shipped.** Full simulation engine + render/bundle + exposure filtering + CLI commands + validation harness implemented. v4 engine changes + build pipeline merged (PR #21). v4 dataset generated and validated. PR-agent refresh fallback wiring fixed for bot-authored reviews. 609 tests passing. --- diff --git a/.github/workflows/pr-agent-context-refresh-dispatcher.yml b/.github/workflows/pr-agent-context-refresh-dispatcher.yml index b04d6d7..04c4095 100644 --- a/.github/workflows/pr-agent-context-refresh-dispatcher.yml +++ b/.github/workflows/pr-agent-context-refresh-dispatcher.yml @@ -163,6 +163,8 @@ jobs: pull_request_number: String(pr.number), pull_request_head_sha: pr.head.sha, pull_request_base_sha: pr.base.sha, + trigger_event_name: 'schedule', + trigger_event_action: '', }, }); diff --git a/.github/workflows/pr-agent-context-refresh.yml b/.github/workflows/pr-agent-context-refresh.yml index bc36541..2b99ace 100644 --- a/.github/workflows/pr-agent-context-refresh.yml +++ b/.github/workflows/pr-agent-context-refresh.yml @@ -1,4 +1,23 @@ name: PR agent context refresh +run-name: >- + ${{ + github.event_name == 'workflow_dispatch' && + format( + 'scheduled refresh PR #{0} @ {1}', + github.event.inputs.pull_request_number, + github.event.inputs.pull_request_head_sha + ) || + github.event_name == 'pull_request_review' && + format('review refresh PR #{0}', github.event.pull_request.number) || + github.event_name == 'pull_request_review_comment' && + format('review-comment refresh PR #{0}', github.event.pull_request.number) || + github.event_name == 'check_run' && + format( + 'check refresh {0}', + github.event.check_run.pull_requests[0].number || github.event.check_run.head_sha + ) || + github.workflow + }} on: pull_request_review: @@ -21,6 +40,16 @@ on: description: Base SHA of the PR required: true type: string + trigger_event_name: + description: Synthetic trigger event name used in rendered metadata + required: false + default: workflow_dispatch + type: string + trigger_event_action: + description: Synthetic trigger event action used in rendered metadata + required: false + default: "" + type: string # SHA-aware concurrency: workflow_dispatch runs key on PR+SHA so same-PR/different-SHA # dispatches are not cancelled, but duplicate dispatches for the same PR+SHA are. @@ -34,7 +63,7 @@ concurrency: github.event.check_run.head_sha || github.sha }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }} permissions: contents: read @@ -45,7 +74,10 @@ jobs: pr-agent-context-refresh: name: PR agent context refresh if: >- - github.event_name == 'workflow_dispatch' || + (github.event_name == 'workflow_dispatch' && + github.event.inputs.pull_request_number != '' && + github.event.inputs.pull_request_base_sha != '' && + github.event.inputs.pull_request_head_sha != '') || (github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_review_comment' && @@ -59,6 +91,11 @@ jobs: with: tool_ref: v4 execution_mode: refresh + trigger_event_name_override: ${{ github.event.inputs.trigger_event_name || '' }} + trigger_event_action_override: ${{ github.event.inputs.trigger_event_action || '' }} + pull_request_number_override: ${{ github.event.inputs.pull_request_number || '' }} + pull_request_head_sha_override: ${{ github.event.inputs.pull_request_head_sha || '' }} + pull_request_base_sha_override: ${{ github.event.inputs.pull_request_base_sha || '' }} publish_mode: append include_review_comments: true include_outdated_review_threads: true @@ -67,10 +104,8 @@ jobs: include_patch_coverage: true target_patch_coverage: "100" coverage_artifact_prefix: pr-agent-context-coverage + coverage_source_workflows: CI enable_cross_run_coverage_lookup: true wait_for_reviews_to_settle: true publish_all_clear_comments_in_refresh: false debug_artifacts: true - pull_request_number: ${{ inputs.pull_request_number || '' }} - pull_request_head_sha: ${{ inputs.pull_request_head_sha || '' }} - pull_request_base_sha: ${{ inputs.pull_request_base_sha || '' }} From e68ae781cd36eb37bcdfec92ce15307304a133dc Mon Sep 17 00:00:00 2001 From: Shay Palachy Date: Thu, 30 Apr 2026 07:07:28 +0300 Subject: [PATCH 2/2] Address refresh workflow review comments --- .github/workflows/pr-agent-context-refresh.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-agent-context-refresh.yml b/.github/workflows/pr-agent-context-refresh.yml index 2b99ace..f4e40e5 100644 --- a/.github/workflows/pr-agent-context-refresh.yml +++ b/.github/workflows/pr-agent-context-refresh.yml @@ -3,7 +3,7 @@ run-name: >- ${{ github.event_name == 'workflow_dispatch' && format( - 'scheduled refresh PR #{0} @ {1}', + 'dispatch refresh PR #{0} @ {1}', github.event.inputs.pull_request_number, github.event.inputs.pull_request_head_sha ) || @@ -52,7 +52,8 @@ on: type: string # SHA-aware concurrency: workflow_dispatch runs key on PR+SHA so same-PR/different-SHA -# dispatches are not cancelled, but duplicate dispatches for the same PR+SHA are. +# dispatches can run independently. Direct event-triggered refreshes cancel older in-flight runs; +# workflow_dispatch refreshes share the PR+SHA group but are allowed to finish instead of being cancelled. concurrency: group: >- pr-agent-context-refresh-${{