Guard autofix dispatch with current OpenCode review#278
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens the criteria for dispatching automated “review autofix” runs so they only trigger when there is a current-head OpenCode CHANGES_REQUESTED review, while still including unresolved review threads as supplemental context (not standalone evidence).
Changes:
- Update
needs_autofix()to early-return unless the PR has a current-head OpenCode change request that is considered autofixable. - Add a regression test ensuring thread-only feedback does not trigger an autofix run.
- Adjust existing test wording to match the new dispatch criteria.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_pr_review_fix_scheduler.py | Adds regression coverage for “thread-only feedback should not dispatch autofix” and updates an existing test’s description to match the new behavior. |
| scripts/ci/pr_review_fix_scheduler.py | Makes needs_autofix() require current-head OpenCode change requests before considering threads as additional context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if not (has_current_head_changes_requested(pr) and change_request_is_autofixable(pr)): | ||
| return False, () |
There was a problem hiding this comment.
Fixed in d7ea1ee — the skip message in inspect_pr() was updated to "no current-head autofixable OpenCode change request", and the matching assertion in test_fix_inspect_skip_wait_and_error_paths was updated accordingly.
OpenCode Review Overview
Pull request overviewOpenCode reviewed the current-head evidence but found unresolved reviewer or review-agent threads before approval. Findings1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved reviewer thread blocks automated approval
Review thread evidenceLatest unresolved reviewer thread evidence
|
e1d6a87 to
f0c857c
Compare
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head evidence but found unresolved reviewer or review-agent threads before approval.
Findings
1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved reviewer thread blocks automated approval
- Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human or review-agent thread evidence on the current pull request.
- Root cause: Reviewer and review-agent feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
- Fix: Address or resolve the listed reviewer thread(s), then re-run OpenCode on the current head.
- Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE, including bot review agents other than OpenCode itself.
Review thread evidence
Latest unresolved reviewer thread evidence
scripts/ci/pr_review_fix_scheduler.py line 118
-
Latest reviewer comment: @copilot-pull-request-reviewer at 2026-07-01T09:20:08Z
-
Comment URL: #278 (comment)
-
Comment excerpt: 'needs_autofix()' now requires a current-head OpenCode change request to be present, so the skip reason returned by 'inspect_pr()' ("no current-head change request or active unresolved review thread") is now misleading: unresolved threads are no longer standalone dispatch evidence. Update the skip message (and/or the logic that produces it) so it reflects the new gating behavior.
-
Result: REQUEST_CHANGES
-
Reason: unresolved reviewer or review-agent thread(s) were present before approval.
-
Head SHA:
f0c857c6d9ad5101c6f410e86b200c5b8eaa33f6 -
Workflow run: 28507829736
-
Workflow attempt: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow (2 files)"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow (2 files)"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["CI script (3 files)"]
S2 --> I2["review and security gate shell path"]
I2 --> R2["Review risk: CI script (3 files)"]
R2 --> V2["bash -n plus Strix self-test"]
Evidence --> S3["Test (2 files)"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test (2 files)"]
R3 --> V3["targeted test run"]
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head evidence but found unresolved reviewer or review-agent threads before approval.
Findings
1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved reviewer thread blocks automated approval
- Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human or review-agent thread evidence on the current pull request.
- Root cause: Reviewer and review-agent feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
- Fix: Address or resolve the listed reviewer thread(s), then re-run OpenCode on the current head.
- Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE, including bot review agents other than OpenCode itself.
Review thread evidence
Latest unresolved reviewer thread evidence
scripts/ci/pr_review_fix_scheduler.py line 118
-
Latest reviewer comment: @copilot-pull-request-reviewer at 2026-07-01T09:20:08Z
-
Comment URL: #278 (comment)
-
Comment excerpt: 'needs_autofix()' now requires a current-head OpenCode change request to be present, so the skip reason returned by 'inspect_pr()' ("no current-head change request or active unresolved review thread") is now misleading: unresolved threads are no longer standalone dispatch evidence. Update the skip message (and/or the logic that produces it) so it reflects the new gating behavior.
-
Result: REQUEST_CHANGES
-
Reason: unresolved reviewer or review-agent thread(s) were present before approval.
-
Head SHA:
d7ea1ee5f17a96c2f6ab5804e7ce3f21210ef22c -
Workflow run: 28508619714
-
Workflow attempt: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow (2 files)"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow (2 files)"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["CI script (3 files)"]
S2 --> I2["review and security gate shell path"]
I2 --> R2["Review risk: CI script (3 files)"]
R2 --> V2["bash -n plus Strix self-test"]
Evidence --> S3["Test (2 files)"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test (2 files)"]
R3 --> V3["targeted test run"]
Summary
Verification