Fix runtime runner provisioning regressions after merged x64 patch#20
Fix runtime runner provisioning regressions after merged x64 patch#20
Conversation
Avoid false amd64 mismatch failures by relying on Docker platform pinning at container create time, skip reconciler orphan cleanup for provisioning runners, and tolerate missing archive cleanup during concurrent runner lifecycle events. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request fixes three runtime runner provisioning regressions that were introduced after a previous x64 patch. The changes simplify Docker image handling, prevent premature runner deletion, and handle file cleanup race conditions.
Changes:
- Simplified Docker image provisioning by trusting Docker's built-in platform pinning instead of manual architecture verification and tagging
- Added logic to prevent reconciler from deleting runners in
pendingorconfiguringstates before they register with GitHub - Added tolerance for
ENOENTerrors during archive cleanup to handle race conditions in the native runner download flow
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/src/services/dockerRunner.ts | Removed complex architecture verification and tagging logic; now relies on Docker's platform parameter |
| backend/src/services/reconciler.ts | Added shouldSkipGitHubExistenceCheck function to skip GitHub existence validation for provisioning runners |
| backend/tests/reconciler.test.ts | Added unit tests for the new shouldSkipGitHubExistenceCheck function |
| backend/src/services/runnerManager.ts | Added error handling to tolerate ENOENT errors when unlinking archive files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on March 17
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| // Newly provisioning runners are expected to not exist in GitHub yet. | ||
| if (shouldSkipGitHubExistenceCheck(runner.status)) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Stuck provisioning runners are never cleaned up
Medium Severity
shouldSkipGitHubExistenceCheck unconditionally skips runners in pending/configuring status with no time-based bound. If provisioning hangs or the creating process crashes without transitioning the status to error, these runners remain in the database indefinitely — the reconciler never cleans them up, since neither the orphan check nor the stale-heartbeat query (which only matches online/busy) covers them.
| ): Promise<string> { | ||
| const d = initDocker(); | ||
| const platform = `linux/${architecture}`; | ||
|
|
There was a problem hiding this comment.


Summary
pending/configuring)ENOENTon unlink)Validation
npm run typecheck -w backendnpm run test -w backend -- tests/dockerRunner.test.ts tests/reconciler.test.tsNote
Medium Risk
Changes affect runner lifecycle/provisioning and reconciliation behavior; mistakes could leave orphaned runners or pull the wrong image architecture, but the diff is small and covered by targeted tests.
Overview
Fixes Docker runner provisioning by removing the architecture-specific retagging/inspection flow in
pullRunnerImageand instead relying solely on Docker’s--platformpull, returning the baseRUNNER_IMAGEreference.Prevents the reconciler from deleting runners that are still provisioning by skipping the GitHub existence/orphan check for
pendingandconfiguringstatuses (with new unit tests forshouldSkipGitHubExistenceCheck).Hardens native runner downloads by making archive cleanup tolerant of
ENOENTonfs.unlink, avoiding failures from concurrent/racy cleanup.Written by Cursor Bugbot for commit 4900183. This will update automatically on new commits. Configure here.