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
2 changes: 1 addition & 1 deletion .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ jobs:
fi
if [ "${live_poll_head,,}" != "${HEAD_SHA,,}" ]; then
echo "::notice::Pull request head moved while waiting for a current-head OpenCode verdict; retiring superseded Required OpenCode Review poll."
exit 1
exit 0
Comment thread
seonghobae marked this conversation as resolved.
Comment thread
seonghobae marked this conversation as resolved.
fi
if [ "$live_poll_state" = "closed" ]; then
echo "PR closed while waiting for the current-head OpenCode verdict; the poll is no longer required."
Expand Down
9 changes: 3 additions & 6 deletions tests/test_opencode_poll_self_retirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ def test_poll_live_state_revalidation_fails_closed_on_malformed_evidence() -> No
def test_poll_executes_superseded_head_retirement_before_reviews_read(
tmp_path: Path,
) -> None:
"""A moved head exits non-passing before the Reviews API is consulted."""
"""A moved head exits successfully before the Reviews API is consulted."""
head_sha = "a" * 40
result, calls = _run_poll_loop(
tmp_path,
head_sha=head_sha,
live_pr={"head": {"sha": "b" * 40}, "draft": False, "state": "open"},
)

assert result.returncode == 1
assert result.returncode == 0
assert "retiring superseded Required OpenCode Review poll" in result.stdout
assert calls == ["api repos/ContextualWisdomLab/example/pulls/42"]

Expand Down Expand Up @@ -393,7 +393,6 @@ def test_poll_fails_closed_after_wall_clock_deadline_with_every_gh_call_succeedi
"::error::No current-head OpenCode verdict after 180 minutes of "
"polling; failing closed and releasing the runner." in result.stdout
)
# Distinct diagnostic from the transport-failure path: nothing here failed.
assert "consecutive times" not in result.stdout
assert calls == [
"api repos/ContextualWisdomLab/example/pulls/42",
Expand All @@ -420,7 +419,7 @@ def test_poll_wall_clock_deadline_does_not_interfere_with_a_fast_verdict(
"body": "Source-backed current-head semantic review.",
}
],
date_epochs=[1000, 1000], # baseline call, then one in-bounds iteration check
date_epochs=[1000, 1000],
)

assert result.returncode == 0, result.stderr
Expand Down Expand Up @@ -453,8 +452,6 @@ def test_wall_clock_deadline_is_distinct_from_and_additional_to_transport_counte
"::error::No current-head OpenCode verdict after 180 minutes of "
"polling; failing closed and releasing the runner." in loop
)
# The deadline check must precede this iteration's gh calls so an
# already-expired deadline never spends another API request.
assert loop.index('-ge "$poll_deadline_epoch"') < loop.index(
'live_poll_pr="$(timeout 30s gh api'
)
Loading