Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,25 @@ jobs:
review_poll_failures=0
max_poll_transport_failures=3
poll_interval_seconds=60
# Wall-clock backstop, distinct from max_poll_transport_failures above:
# that counter only bounds *consecutive transport failures*, so a
# review dispatch that never produces a verdict -- while every
# individual `gh api` call keeps succeeding -- previously polled
# forever, holding a live runner for up to GitHub's 360-minute
# platform default job timeout. 10800s (3h) is chosen to stay
# comfortably above this org's own documented "accommodate over 2
# hours per model" allowance (docs/product-goal-directive.md §8)
# while still releasing the runner well before the platform
# default. This bounds how long the CI job waits for a verdict; it
# does not cap the model's own reasoning/streaming time, which
# remains governed entirely upstream by the dispatched review run
# itself.
poll_deadline_epoch=$(( $(date -u +%s) + 10800 ))
while :; do
if [ "$(date -u +%s)" -ge "$poll_deadline_epoch" ]; then
Comment on lines +439 to +441

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: Epoch arithmetic is mechanically sound

On the pinned Ubuntu runner, date -u +%s and Bash arithmetic support this range. A date failure also stops the step closed.

Devin Review

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

echo "::error::No current-head OpenCode verdict after 180 minutes of polling; failing closed and releasing the runner."
exit 1
Comment on lines +439 to +443

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.

🔴 Long reviews lose required approval

When a verdict needs over three hours, poll_deadline_epoch fails the required check before the authorized review finishes. The completed verdict cannot satisfy that run.

Prompt for agents
Replace the fixed three-hour admission deadline in .github/workflows/opencode-review.yml's current-head verdict poll with a capacity-safe design that does not impose a fixed wall-clock cutoff on an active review. The current repository contract in docs/adr/0003-contextual-orchestrator-vendored-free-zdr.md and docs/adr/0005-sidecar-preflight-token-budget.md permits hours-long model work and ends it only for operator action or an obsolete PR head. If one runner cannot remain occupied indefinitely, split polling across short-lived event-driven or redispatched runs while preserving the same exact-head verdict admission. Update the workflow execution tests to cover a verdict produced after the former three-hour boundary.
Devin Review

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

Comment on lines +441 to +443

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.

🟡 Final-minute verdicts are discarded

When a verdict arrives during the final sleep, poll_deadline_epoch exits before reading it. The required check fails despite timely evidence.

Prompt for agents
If the three-hour policy remains, restructure the polling loop so reaching the deadline cannot bypass a verdict that arrived before it. Preserve live-head, state, and draft revalidation, perform a final Reviews API read at the boundary, and fail only when that read still finds no admissible current-head verdict. Add an executable test with the verdict appearing during the last sleep interval.
Devin Review

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

Comment on lines +439 to +443

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.

🔍 Deadline lacks durable regression coverage

Existing loop tests omit poll_deadline_epoch, so they no longer execute production setup faithfully. Add expiration, immediate-verdict, and boundary-arrival cases.

Devin Review

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

fi
if ! live_poll_pr="$(timeout 30s gh api "repos/${TARGET_REPOSITORY}/pulls/${PR_NUMBER}")"; then
live_poll_failures=$((live_poll_failures + 1))
if [ "$live_poll_failures" -ge "$max_poll_transport_failures" ]; then
Expand Down
Loading