From 81578f8326df2b74ff29f6c5f322391924a2cc3d Mon Sep 17 00:00:00 2001 From: "Ralph Sto. Domingo" Date: Mon, 23 Nov 2026 22:19:52 +0800 Subject: [PATCH 1/2] fix(ci): show the failed build attempt's exit code, and time-box each attempt The release build retry now prints why attempt 1 failed (exit code, or a 5-minute timeout), and caps each attempt at 5 minutes so a hung build still leaves room for the retry inside the job's 15 minutes. Follow-up to #1823. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi --- .github/workflows/release.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27cd7da004..6c0da7baf3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: include: - # Each target builds ONE binary in parallel (~5 min each) + # Each target builds ONE binary in parallel (under 30s each) # Index matches allTargets array in build.ts. Targets without a # @altimateai/altimate-core NAPI prebuild (linux-*-musl, win32-arm64) # are intentionally excluded — see allTargets in build.ts. @@ -92,14 +92,25 @@ jobs: # altimate_change start — retry a failed build once, so one flaky target can't hold up # the release (see the Solid plugin warm-up in build.ts for the flake we know of). The # retry is a new `bun run`: Bun keeps a misread resolver entry for the life of the - # process. The warning keeps the first failure visible on the run summary. + # process. The warning keeps the first failure visible on the run summary. Each attempt + # gets 5 minutes (a build takes under 30s), so a hung first attempt still leaves time + # for the second inside the job's 15 minutes. run: | for attempt in 1 2; do - if bun run packages/opencode/script/build.ts --target-index=${{ matrix.index }}; then + status=0 + timeout --kill-after=30s 5m bun run packages/opencode/script/build.ts --target-index=${{ matrix.index }} || status=$? + if [ "$status" = 0 ]; then exit 0 fi + if [ "$status" = 124 ]; then + reason="timed out after 5 minutes" + else + reason="exited with code $status" + fi if [ "$attempt" = 1 ]; then - echo "::warning::Build (${{ matrix.name }}) failed on attempt 1; retrying once in a fresh process" + echo "::warning::Build (${{ matrix.name }}) attempt 1 $reason; retrying once in a fresh process" + else + echo "::error::Build (${{ matrix.name }}) attempt 2 $reason" fi done exit 1 From 0ccaed6277113e69e3c1c66cab652e09ba548f9c Mon Sep 17 00:00:00 2001 From: "Ralph Sto. Domingo" Date: Mon, 23 Nov 2026 22:37:56 +0800 Subject: [PATCH 2/2] fix(ci): call an attempt timed out only if it ran its full time A build that exits 124 by itself was reported as a timeout. The limit is now set once and the message reads it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi --- .github/workflows/release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c0da7baf3..05415a49d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,17 +93,20 @@ jobs: # the release (see the Solid plugin warm-up in build.ts for the flake we know of). The # retry is a new `bun run`: Bun keeps a misread resolver entry for the life of the # process. The warning keeps the first failure visible on the run summary. Each attempt - # gets 5 minutes (a build takes under 30s), so a hung first attempt still leaves time - # for the second inside the job's 15 minutes. + # gets attempt_timeout (a build takes under 30s), so a hung first attempt still leaves + # time for the second inside the job's 15 minutes. run: | + attempt_timeout=300 # seconds for attempt in 1 2; do status=0 - timeout --kill-after=30s 5m bun run packages/opencode/script/build.ts --target-index=${{ matrix.index }} || status=$? + started=$SECONDS + timeout --kill-after=30s "${attempt_timeout}s" bun run packages/opencode/script/build.ts --target-index=${{ matrix.index }} || status=$? if [ "$status" = 0 ]; then exit 0 fi - if [ "$status" = 124 ]; then - reason="timed out after 5 minutes" + # timeout exits 124 when it stopped the attempt; a build that exits 124 itself does so early. + if [ "$status" = 124 ] && [ $((SECONDS - started)) -ge "$attempt_timeout" ]; then + reason="timed out after ${attempt_timeout}s" else reason="exited with code $status" fi