Skip to content

Bound OpenCode review cadence and scheduler backlog#383

Closed
seonghobae wants to merge 4 commits into
mainfrom
fix/opencode-review-cadence
Closed

Bound OpenCode review cadence and scheduler backlog#383
seonghobae wants to merge 4 commits into
mainfrom
fix/opencode-review-cadence

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Required OpenCode Review checks are blocking merges across the org when the model pool hangs or exhausts provider capacity. The old behavior either let one model/provider consume the whole step or ended with an opaque GitHub Actions timeout, so PRs accumulated without a source-backed APPROVE/REQUEST_CHANGES result or a useful failure reason.

Current decision

This PR is the canonical OpenCode review cadence fix. It supersedes older conflicting budget PRs (#281, #348, #372).

  • Put github-models/deepseek/deepseek-v3-0324 first because it has the best observed success rate in the current org queue.
  • Keep compact reasoning fallbacks next, then broader catalog fallbacks, with rate-starved flagships last.
  • Use a 90-minute per-model window (OPENCODE_RUN_TIMEOUT_SECONDS=5400) so deep reviews are not cut short.
  • Bound the total model-pool retry budget to 300 minutes (OPENCODE_TOTAL_RETRY_BUDGET_SECONDS=18000) inside a 330-minute step, leaving time for the publish/approval gate to log the explicit reason when no model succeeds.
  • Keep the approval gate running with always() so model-pool failure becomes visible review evidence instead of disappearing behind a skipped gate.
  • Set scheduler dispatch defaults to process the backlog instead of only one PR per cadence loop.

Verification

  • py -3 -m pytest tests/test_opencode_agent_contract.py tests/test_opencode_review_normalize_output.py tests/test_pr_review_fix_scheduler.py -> 56 passed, 1 skipped.
  • git diff --check -> passed.
  • codegraph sync . -> completed.
  • bash -n scripts/ci/test_strix_quick_gate.sh did not complete within 120s on this Windows workspace; the edited assertions are covered by the Python contract test and static grep checks.

Queue cleanup

Closed superseded/contradictory OpenCode budget PRs:

@seonghobae seonghobae enabled auto-merge (squash) July 9, 2026 07:14
@seonghobae seonghobae requested a review from Copilot July 9, 2026 07:49
@seonghobae

Copy link
Copy Markdown
Contributor Author

Superseded by #382. The 30-minute/10-minute concern is addressed there with DeepSeek V3 first, 90 minutes per model, and a 300-minute model-pool budget while preserving the safer merge-ref coverage checkout and least-privilege security workflow changes.

@seonghobae seonghobae closed this Jul 9, 2026
auto-merge was automatically disabled July 9, 2026 08:05

Pull request was closed

@seonghobae

Copy link
Copy Markdown
Contributor Author

Local verification on current head 791685412186f25e6eab10f1de0e1b5a96ec85ef while GitHub-hosted Actions are queued:

  • python -m pytest tests/test_opencode_agent_contract.py -q -> 12 passed, 1 skipped.
  • python -m pytest tests/test_opencode_workflow_shell_syntax.py -q -> 1 passed.

No branch changes were made for this verification.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR adjusts the OpenCode review workflow to prevent org-wide merge blocking when model providers hang or exhaust capacity, by bounding model-pool retries and ensuring the publish/approval gate still runs to emit an explicit outcome.

Changes:

  • Reorder the model candidate pool (DeepSeek V3 first) and add a total retry budget to keep the pool bounded.
  • Allow the model-pool step to fail without aborting the job, and run the approval/publish gate unconditionally (always()).
  • Change merge-scheduler dispatch defaults to process backlog (default -1) instead of dispatching a single PR per run.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/test_opencode_agent_contract.py Updates contract expectations for model ordering, timeouts, and model-pool behavior.
scripts/ci/test_strix_quick_gate.sh Aligns workflow assertions with the new timeouts, retry budget, and always-run publish gate.
.github/workflows/pr-review-merge-scheduler.yml Changes scheduler input defaults to “process backlog” semantics.
.github/workflows/opencode-review.yml Implements bounded model-pool timing/budget and ensures the publish/approval step runs even after pool failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

description: Maximum OpenCode/Strix review dispatch actions per scheduler run
required: false
default: "1"
default: "-1"
description: Maximum OpenCode/Strix review dispatch actions per scheduler run
required: false
default: "1"
default: "-1"
Comment on lines 2335 to +2339
- name: Run OpenCode PR Review model pool
id: opencode_review_model_pool
if: needs.coverage-evidence.result == 'success'
timeout-minutes: 350
timeout-minutes: 330
continue-on-error: true
Comment on lines 2719 to +2720
- name: Approve PR if OpenCode review passed
if: >-
always()
&& (
needs.coverage-evidence.result != 'success'
|| steps.opencode_review_model_pool.outcome == 'success'
)
if: always()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants