Retry phone-home while the backend binding is pending; fail the job if the handshake never lands - #13
Conversation
…b if it never lands Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e38ebc1. Configure here.
|
|
||
| if [ "$(date +%s)" -ge "$PHONE_HOME_DEADLINE" ]; then | ||
| echo "::error::Testbox phone-home did not succeed before the deadline (last HTTP ${HTTP_CODE}, ${ATTEMPT} attempts): $(cat "$PHONE_HOME_RESPONSE_FILE" 2>/dev/null)" | ||
| exit 1 |
There was a problem hiding this comment.
Later steps run after handshake failure
Low Severity
Handshake failures now exit 1 before writing ssh_public_key, but later steps still run because their if does not include success(). The SSH install step then fails on a missing file, adding a misleading error after the real phone-home failure.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e38ebc1. Configure here.
There was a problem hiding this comment.
False positive: a step if without a status-check function implicitly includes success(), so the later steps are skipped once the phone-home step exits 1. The SSH install step also uses cat ... 2>/dev/null behind an [ -n ] guard, so a missing key file cannot produce a failure there.
There was a problem hiding this comment.
Composite action steps with an if that lacks a status function are implicitly wrapped in success() && (...), so these steps are skipped once phone-home exits 1. The SSH install step also tolerates a missing key file (cat ... 2>/dev/null guarded by [ -n ]), so it cannot emit a misleading error.


Companion to useblacksmith/web#13145, addressing https://github.com/useblacksmith/web/pull/13145#issuecomment-5704151176.
The first phone-home fires as soon as the job starts, which can beat warmup's write of the dispatched run ID and the adoption webhook. Once the backend enforces callback binding it answers
503+Retry-Afterwhile that binding is pending, and403for a definitive mismatch. Previously the action made a singlecurl -fcall and on any failure "continued in degraded mode" with an empty SSH key, leaving the testbox permanently unusable since the laterreadycallback does not install the key.The phone-home step now retries transient failures (connection errors, 408/425/429, 5xx) every 2s for up to 90s, breaks on 2xx, and fails the step (so the job) on any other 4xx or when the deadline passes, with the backend's error body in the log. Missing metadata (backendURL, installationModelID, stickyDiskToken) also fails the step instead of silently skipping, since no handshake is possible without it.
Verified locally against a stub backend: 503,503,200 succeeds on attempt 3 and writes the SSH key and idle timeout; 403 exits 1 immediately; an unreachable backend exits 1 once the deadline passes. Behavior change to note: a failed handshake now fails the workflow job rather than letting it run without SSH access.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled. (Staging)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.