Skip to content

fix(scheduler): retry OpenCode after coverage blockers clear - #1266

Merged
seonghobae merged 18 commits into
codex/scheduler-independent-exact-head-approval-20260824from
codex/pr1152-current-main-replacement-20260824
Aug 24, 2026
Merged

fix(scheduler): retry OpenCode after coverage blockers clear#1266
seonghobae merged 18 commits into
codex/scheduler-independent-exact-head-approval-20260824from
codex/pr1152-current-main-replacement-20260824

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Protected-main replacement for #1152. It keeps the source-backed coverage-only retry and removes the stale audit-lock and unrelated docstring churn from the conflicted predecessor.

Root cause

A current-head OpenCode review can request changes solely because coverage-evidence was not yet available. Once exact-head coverage and Strix evidence become successful, the scheduler still returned at the existing CHANGES_REQUESTED gate, so the same head never received the review needed to clear that gate.

The original retry also used the environment-sensitive is_opencode_context() classifier to ignore its superseded failing OpenCode CheckRun. Under the central required-workflow deployment that classifier deliberately treats CheckRuns as non-authoritative placeholders, which made the placeholder failure self-block the retry.

Change

  • authenticate the latest exact-head OpenCode change request as coverage-only from the established gate markers;
  • require successful exact-head coverage and Strix evidence and no unrelated failed checks before dispatch;
  • ignore only the superseded OpenCode failure, including the central required-workflow placeholder;
  • keep unresolved review threads, ordinary source findings, unrelated failed checks, disabled dispatch, and active same-head runs fail-closed;
  • document the operational boundary in CHANGELOG.md.

Exact local evidence

  • Base: 885f2cd251999f21cf562cab3e2d9cc3cc3ec737
  • Head: 9f2ab9ae2f97be49fc4ab4dbcd13123057005b97
  • RED: the required-workflow placeholder regression returned block instead of review_dispatch before the fix.
  • Focused scheduler: 115 passed.
  • Full central suite in a fresh uv environment with the independently tracked pip bootstrap supplied through uv run --with pip: 1394 passed, 1 skipped, 16 subtests passed.
  • Coverage: 8385 statements and 3240 branches, 100%.
  • Production docstrings: 100% across scripts/ci.
  • compileall and git diff --check: pass.

No approval, protected check, or unresolved-thread requirement is bypassed. An independent exact-head verdict remains required before merge.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 48 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bf66e18f-23e7-4081-9004-b89e0aaa0da1

📥 Commits

Reviewing files that changed from the base of the PR and between 0c6b9a6 and 0ffad34.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • scripts/ci/pr_review_merge_scheduler.py
  • tests/test_pr_review_merge_scheduler.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae enabled auto-merge (squash) August 24, 2026 03:58
@seonghobae

Copy link
Copy Markdown
Contributor Author

Implemented in 9cc3aca.

The same-head coverage retry-floor branch now disables an existing auto-merge request before returning the wait decision. Added a regression test covering an auto-merge-enabled current-head coverage-only review; the scheduler now remains fail-closed until the retry floor elapses without leaving auto-merge active.

Verification: 1408 passed, 1 skipped, 16 subtests; compileall; git diff --check.

devin-ai-integration[bot]

This comment was marked as resolved.

@opencode-agent
opencode-agent Bot disabled auto-merge August 24, 2026 04:41
@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head check RCA: Strix run 32688700442 failed closed after provider-infrastructure output, no report artifact, NVIDIA fallback failure, and direct fallback LLM Provider NOT provided. No source vulnerability evidence is present; revalidate after the provider/failover root is healthy.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head update: 2a30943

Fixed the valid coverage-retry finding. The same-head retry floor now uses the later of the exact-head coverage review submission and the latest completed exact-head OpenCode repository-dispatch start. If dispatch history cannot be read, the scheduler waits fail-closed. This prevents repeated dispatch when a review run completes without publishing a new review.

The central-deployment progress observation is retained as an intentional optimization boundary: CheckRun placeholders are non-authoritative, while dispatch_opencode_review remains the authoritative same-head active-run deduplicator.

Local verification on this exact head: 1415 passed, 1 skipped, 16 subtests; statement and branch coverage 100%; public scheduler docstrings 100%; ruff check, compileall, and git diff check passed.

Please re-review this exact head and publish substantive exact-head verdict evidence.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent review exact head 2a30943. Read the complete changed-file diff, verify the dispatch-history retry floor and central active-run boundary, then publish substantive review evidence tied to this exact head.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head finding disposition

Current exact head before restack: 2a30943

  • Central-deployment progress: the progress value is an optimization signal. Correctness remains guarded by the exact-head dispatch deduplication result from dispatch_opencode_review, so an OpenCode CheckRun that is not visible to the progress probe cannot create a duplicate dispatch.
  • Completed-run lookup: the additional request is limited to the non-dry-run coverage-only retry path and reads the newest bounded page; it supplies the retry anchor when no review publication exists. Removing it would reintroduce repeated hourly dispatch after a run completed without a review.

These are intentional bounded trade-offs rather than source defects. I will restack this branch onto the current main and request a fresh exact-head review after the base changes.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Restack complete: exact-head re-review required

The branch was updated through the normal PR path onto current main. Current exact head: 0ffad34. Current exact base: 0c6b9a6.

All predecessor checks and reviews are stale after the base update. The scheduler retry-anchor fix and its regression tests are present; the two informational findings were dispositioned with their correctness and bounded-cost rationale. Please inspect the complete current diff and publish a substantive review for this exact head. No merge is requested until required checks and independent approval are current.

@seonghobae
seonghobae changed the base branch from main to codex/scheduler-independent-exact-head-approval-20260824 August 24, 2026 07:16
@seonghobae
seonghobae merged commit ccc1220 into codex/scheduler-independent-exact-head-approval-20260824 Aug 24, 2026
34 of 38 checks passed
@seonghobae
seonghobae deleted the codex/pr1152-current-main-replacement-20260824 branch August 24, 2026 07:20
@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head stack verification receipt

  • Exact root/base PR: fix(scheduler): require independent exact-head approval #1270 at 6cb714470c5a0c31b36cb64df8959cd020f22d52
  • Exact follow-up PR head: fix(scheduler): retry OpenCode after coverage blockers clear #1266 at 0ffad34c087a56f1ceb526148bc773b0667a2902
  • Retargeted base: codex/scheduler-independent-exact-head-approval-20260824
  • Synthetic stack commit: bac4bb9add4c27c199980d68c1568143ad1eff35
  • Verified stack tree: 4dde1e61e5583c9e9df4e5929dc5ed979d428376
  • Stack conflict: none
  • Full merge-result suite: 1428 passed, 1 skipped, 16 subtests
  • Production statement and branch coverage: 100%
  • Public docstrings: 100%
  • Ruff, Python compile, and diff check: passed
  • Decision: WAIT_AND_REMEDIATE while the new-base required Checks and exact-head independent review complete; normal squash auto-merge is enabled.

Predecessor main-base evidence is discarded after retarget. No force push, protected-branch write, approval, fake status, or bypass was used.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +1362 to +1379
review = latest_current_head_coverage_change_request(pr)
if review is None:
return None
submitted_at = parse_github_datetime(review.get("submittedAt"))
if submitted_at is None:
return "current-head OpenCode coverage review has no valid submission timestamp; defer same-head re-review"
retry_anchor = submitted_at
if repo and workflow:
try:
dispatch_started_at = latest_opencode_dispatch_started_at(repo, workflow, pr)
except RuntimeError:
return "same-head OpenCode dispatch history is unavailable; defer same-head re-review"
if dispatch_started_at and dispatch_started_at > retry_anchor:
retry_anchor = dispatch_started_at
current_time = now or datetime.now(timezone.utc)
if current_time < retry_anchor + timedelta(minutes=max(0, floor_minutes)):
return "same-head OpenCode coverage retry floor has not elapsed"
return None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 Info: Coverage-clear redispatch can wait up to the retry floor

coverage_retry_wait_reason (pr_review_merge_scheduler.py) anchors on the coverage-only review submission time. When coverage reruns and succeeds soon after the review, redispatch still waits up to floor_minutes (default 60) past the review timestamp. This is the intended same-head retry floor and is asserted by tests; noting the operational latency for reviewers.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Superseded PR audit

#1266's exact coverage-retry change is already included in #1270's current head ccc1220cd7710d023d4f10d79ccd170a636b4516.

No force push, direct protected-branch write, approval, fake status, or bypass was used.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Concurrent merge audit correction

Live state re-check confirms this PR was merged normally, not closed:

The earlier audit comment's “close as superseded” wording is superseded by this live GitHub merge record. No force-push, protected-branch direct push, approval fabrication, or bypass was used.

seonghobae added a commit that referenced this pull request Aug 24, 2026
* fix: retry reviews after coverage blockers clear

* fix(scheduler): match coverage blocker review body

* test(scheduler): cover coverage evidence gate branches

* test(scheduler): reproduce coverage retry self-block

* fix(scheduler): unblock coverage-only review retry

* fix(scheduler): preserve central coverage retry

* test(scheduler): cover status-only coverage retry

* fix(scheduler): prefer newest coverage rerun

* fix(scheduler): keep coverage retries fail closed

* fix(scheduler): ignore superseded coverage failures

* fix(scheduler): bind coverage retries to one check snapshot

* fix(scheduler): avoid duplicate coverage review dispatch

* fix(scheduler): rate-limit same-head coverage retries

* fix(scheduler): wait for active coverage re-review

* fix(scheduler): disable auto-merge during coverage retry floor

* fix(scheduler): bound coverage retry dispatches
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.

1 participant