Skip to content

ci(#6462): add retry with backoff to eval setup-fixture.sh - #6465

Merged
ralphbean merged 1 commit into
mainfrom
agent/6462-eval-setup-retry
Sep 9, 2026
Merged

ci(#6462): add retry with backoff to eval setup-fixture.sh#6465
ralphbean merged 1 commit into
mainfrom
agent/6462-eval-setup-retry

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Add exponential-backoff retry logic to eval/scripts/setup-fixture.sh to handle transient GitHub API failures during eval case bootstrap. The script performs multiple network-dependent calls (gh repo create, git clone, git push, gh issue create, gh pr create) under set -euo pipefail with parallelism: 4, making it susceptible to transient failures that cause 4-second crashes and misleading scoring regressions.

Changes

  • Add retry_cmd wrapper function (3 attempts, 2s/4s/8s exponential backoff) with all diagnostic output directed to stderr to prevent stdout contamination in command substitutions
  • Wrap all 7 network-dependent operations with retry_cmd: repo creation, clone, two push calls, two issue-create calls, and PR creation
  • Add retry_clone helper that removes the target directory between attempts so partial clones don't block retries
  • Add eval/scripts/setup-fixture-test.sh with unit tests for retry_cmd: success on first attempt, failure after max attempts, retry-then-succeed, stdout cleanliness, and stdout pass-through

Testing

  • Shell syntax validation (bash -n) passes
  • All 7 unit tests for retry_cmd pass
  • Secret scan passes
  • gitlint --commit HEAD passes

Closes #6462

Post-script verification

  • Branch is not main/master (agent/6462-eval-setup-retry)
  • Secret scan passed (gitleaks — 07c656859c26f0679c2351b2187c2807a2900e82..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

setup-fixture.sh performs multiple network-dependent GitHub API
calls (gh repo create, git clone, git push, gh issue create,
gh pr create) under set -euo pipefail with no retry logic. With
parallelism: 4 in eval.yaml, transient API failures cause
instant 4-second crashes that cascade into misleading scoring
regressions in functional tests.

Add a retry_cmd wrapper (3 attempts, exponential backoff at
2s/4s/8s) around all network operations. All diagnostic output
goes to stderr to prevent stdout contamination in command
substitutions per docs/contributing/shell-scripting.md. The
git clone call uses a retry_clone helper that removes the
target directory between attempts so partial clones don't block
retries.

Add setup-fixture-test.sh with unit tests for retry_cmd:
verifies success, failure after max attempts, retry-then-
succeed, stdout cleanliness, and stdout pass-through.

Note: pre-commit could not run (sandbox network restriction
blocked hook environment setup). lint-eval-cases could not
fully run (yq not available in sandbox). Shell syntax
validation (bash -n) passed.

Closes #6462
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 21, 2026 21:10
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Aug 21, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 21, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:11 PM UTC · Completed 9:27 PM UTC

Commit: 20cf9b7 · View workflow run →

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [stdout contamination on retry] eval/scripts/setup-fixture.sh:28retry_cmd accumulates stdout from ALL attempts (including failed ones) when used inside command substitution. If a wrapped command produces any stdout before failing, that output leaks into the captured variable alongside the successful attempt's output. In practice, gh issue create and gh pr create send errors to stderr on failure, so this is unlikely to trigger today, but the function has no mechanism to isolate stdout per attempt.
    Remediation: Capture stdout to a temporary file inside the retry loop and only emit it on success, or document this limitation prominently so future callers are aware.

  • [inaccurate documentation] eval/scripts/setup-fixture.sh:22 — The comment says "Retries up to 3 times with 2s/4s/8s delays between attempts" but the function makes at most 3 total attempts (2 retries). The 8s delay is computed (delay doubles from 4 to 8) but never used because the third attempt is the final one and no sleep occurs after it. The actual delays between attempts are 2s and 4s only.
    Remediation: Change the comment to "Attempts up to 3 times with 2s/4s delays between attempts" or adjust max_attempts to 4 if 3 retries with 2s/4s/8s was the intended behavior.

  • [test execution time] eval/scripts/setup-fixture-test.sh:16 — The tests extract and run retry_cmd with its real sleep calls. Test 2 (retry_cmd false) sleeps 2s+4s=6s. Test 3 (flaky command failing twice) sleeps 2s+4s=6s. Test 4 (fail once) sleeps 2s. Total: ~14 seconds of sleeping in a unit test suite.

  • [test file convention] eval/scripts/setup-fixture-test.sh:1 — The test file is created with mode 100644 (not executable). The sibling scripts (setup-fixture.sh, teardown-fixture.sh, etc.) are all 100755.
    Remediation: Run chmod +x eval/scripts/setup-fixture-test.sh for consistency with sibling scripts.

Comment thread eval/scripts/setup-fixture.sh
Comment thread eval/scripts/setup-fixture.sh
Comment thread eval/scripts/setup-fixture-test.sh
Comment thread eval/scripts/setup-fixture-test.sh
@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 21, 2026
@ralphbean ralphbean self-assigned this Sep 9, 2026
@ralphbean
ralphbean added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit ec55e9c Sep 9, 2026
65 of 68 checks passed
@ralphbean
ralphbean deleted the agent/6462-eval-setup-retry branch September 9, 2026 18:58
@fullsend-ai-retro

fullsend-ai-retro Bot commented Sep 9, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 7:00 PM UTC · Completed 7:09 PM UTC

Commit: 20cf9b7 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $3.38

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6465ci(#6462): add retry with backoff to eval setup-fixture.sh

Workflow overview

Fully autonomous pipeline from retro-filed issue to merged PR:

Stage Agent Duration Result
Issue filed retro Created from PR #6355 functional test failures
Triage run 32525954189 ~4 min Correctly identified root cause, labeled ready-to-code
Code run 32526430887 ~8 min Single commit, 2 files changed (+171/-8)
Review run 32527194225 ~17 min APPROVED with 4 low-severity findings
Human review ralphbean 19 days later APPROVED without additional findings
Merge ralphbean 2026-09-09 Merged

Total agent time (issue to review): ~33 minutes. Total time to merge: ~19 days (human review backlog).

Quality assessment

Triage quality: Strong. Correctly identified that setup-fixture.sh lacks retry logic for network-dependent GitHub API calls under set -euo pipefail with parallelism: 4.

Code quality: Good with minor issues. The retry_cmd wrapper is well-structured and follows the repo's shell scripting conventions (stderr-only diagnostics). Two minor quality gaps: (1) the function comment claims "2s/4s/8s delays" but the 8s delay is never used since the loop exits after the 3rd attempt — actual delays are 2s/4s only; (2) the test file was created without executable permission while all sibling scripts are 100755.

Review quality: High. The review agent identified 4 valid low-severity findings with zero false positives: stdout contamination risk in command substitutions, inaccurate documentation, 14-second test sleep time, and file permission mismatch. None were addressed before merge.

Evidence for existing issues

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Triage eval case 004-duplicate-issue crashes non-deterministically in CI

1 participant