[codex] Start ephemeral runner before dispatch#39
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the github-actions-runner-job execution flow so the ephemeral runner process is started before dispatching dispatch_then_wait workflows, and ensures partial runner metadata is returned on failures to allow the existing cleanup layer to remove registered runners.
Changes:
- Build/validate dispatch inputs first, then configure and start the runner before dispatching the workflow in
dispatch_then_waitmode. - Return
EphemeralRunnerJobResultwith runner metadata even on run/dispatch errors (so cleanup can still attempt removal). - Add a regression test that fails if workflow dispatch occurs before the (fake) runner listener is started.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/github-actions-runner-job/main.go | Reorders dispatch/runner startup and introduces async runner start/wait support. |
| cmd/github-actions-runner-job/main_test.go | Adds a regression test to enforce “runner started before dispatch” ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
intel352
marked this pull request as ready for review
June 30, 2026 12:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dispatch_then_waitworkflows.Root Cause
github-actions-runner-jobdispatched the target workflow before runningconfig.sh/run.sh --once. If runner registration or listener startup failed after dispatch, the GitHub target run remained queued with no matchingwfc-ghp-*runner visible at the org level. This matched the STG evidence from taskgithub-provider-dogfood-linux-20260630115322: STG task leased, zero proofs, GitHub target run queued, and no ephemeral org runner registered.Adversarial Self-Review
cleanup_status=removed; the existing cleanup layer assigns the final status after removal.Verification
GOWORK=off go test ./cmd/github-actions-runner-job -run TestT915CommandRunsDynamicProviderEnvelopeThroughSidecarAndRunner -count=1failed withrunner listener was not started before dispatch.GOWORK=off go test ./cmd/github-actions-runner-job -run TestT915CommandRunsDynamicProviderEnvelopeThroughSidecarAndRunner -count=1passed.GOWORK=off go test ./cmd/github-actions-runner-job ./internal -run 'EphemeralRunner|RunnerProvider|T915' -count=1passed.GOWORK=off go build ./cmd/github-actions-runner-jobpassed.GOWORK=off go test ./... -count=1passed after rebase ontoorigin/main/v1.0.18.git diff --checkpassed.Supersedes