Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2975,9 +2975,11 @@ jobs:
OPENCODE_RUN_TIMEOUT_SECONDS: "180"
OPENCODE_EXPORT_TIMEOUT_SECONDS: "60"
OPENCODE_TOTAL_RETRY_BUDGET_SECONDS: "540"
# Stop after one catalog pass; the retry budget should fail closed
# with visible diagnostics before the 350-min job timeout.
OPENCODE_POOL_MAX_CYCLES: "1"
# Keep cycling through the high-sensitivity catalog until a model
# emits a valid control block or the bounded retry/step timeout fires.
# A single invalid no-control response is provider/tool state, not a
# source finding.
OPENCODE_POOL_CYCLE_SLEEP_SECONDS: "15"
OPENCODE_BACKOFF_INITIAL_SECONDS: "5"
OPENCODE_BACKOFF_MAX_SECONDS: "5"
OPENCODE_FIRST_ATTEMPT_AGENT: ci-review
Expand Down
18 changes: 10 additions & 8 deletions scripts/ci/run_opencode_review_model_pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,15 @@ main() {
if [ "$run_status" -eq 2 ]; then
break
fi
retry_sleep="$(backoff_sleep "$attempt")"
if [ "$deadline" -gt 0 ] && [ $((SECONDS + retry_sleep)) -gt "$deadline" ]; then
retry_sleep=$((deadline - SECONDS))
fi
if [ "$retry_sleep" -gt 0 ]; then
printf 'Retrying OpenCode after exponential backoff of %ss.\n' "$retry_sleep"
sleep "$retry_sleep"
if [ "$attempt" -lt "$attempts" ]; then
retry_sleep="$(backoff_sleep "$attempt")"
if [ "$deadline" -gt 0 ] && [ $((SECONDS + retry_sleep)) -gt "$deadline" ]; then
retry_sleep=$((deadline - SECONDS))
fi
if [ "$retry_sleep" -gt 0 ]; then
printf 'Retrying OpenCode after exponential backoff of %ss.\n' "$retry_sleep"
sleep "$retry_sleep"
fi
fi
done
done
Expand All @@ -295,7 +297,7 @@ main() {
record_pool_exhausted
exit 1
fi
printf 'OpenCode retry budget and the workflow step timeout remain the outer guards for provider stalls.\n'
printf 'OpenCode retry budget and the workflow step timeout remain the outer guards for invalid or unavailable provider output.\n'
cycle_sleep="${OPENCODE_POOL_CYCLE_SLEEP_SECONDS:-60}"
if [ "$deadline" -gt 0 ] && [ $((SECONDS + cycle_sleep)) -gt "$deadline" ]; then
cycle_sleep=$((deadline - SECONDS))
Expand Down
5 changes: 3 additions & 2 deletions tests/test_opencode_agent_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ def test_workflow_provisions_sandbox_tool_and_reviewer_agent():
assert 'OPENCODE_RUN_TIMEOUT_SECONDS: "180"' in workflow
assert 'OPENCODE_EXPORT_TIMEOUT_SECONDS: "60"' in workflow
assert 'OPENCODE_TOTAL_RETRY_BUDGET_SECONDS: "540"' in workflow
assert 'OPENCODE_POOL_MAX_CYCLES: "1"' in workflow
assert "OPENCODE_POOL_MAX_CYCLES" not in workflow
assert 'OPENCODE_POOL_CYCLE_SLEEP_SECONDS: "15"' in workflow
assert 'OPENCODE_BACKOFF_MAX_SECONDS: "5"' in workflow
assert 'OPENCODE_EXHAUSTED_REKICK_INITIAL_SLEEP_SECONDS: "15"' in workflow
assert 'OPENCODE_EXHAUSTED_REKICK_MAX_SLEEP_SECONDS: "30"' in workflow
Expand All @@ -462,7 +463,7 @@ def test_workflow_provisions_sandbox_tool_and_reviewer_agent():
assert "OpenCode model pool has no configured model candidates." in model_pool_runner
assert 'OPENCODE_TOTAL_RETRY_BUDGET_SECONDS:-2400' in model_pool_runner
assert "completed a full model-candidate cycle without a valid control conclusion" in model_pool_runner
assert "retry budget and the workflow step timeout" in model_pool_runner
assert "workflow step timeout remain the outer guards for invalid or unavailable provider output" in model_pool_runner
assert "OpenCode model pool exhausted before producing a valid control conclusion." in model_pool_runner
assert 'record_review_status "exhausted"' in model_pool_runner
assert "retry budget exhausted" not in model_pool_runner
Expand Down
Loading