Skip to content

Ask the CI k8s sandbox to start on needs_sandbox also when the PR already has that region's label (ENG-226364) - #39

Merged
asheth-eightfold merged 1 commit into
masterfrom
feat/asheth/eng-226364
Nov 18, 2026
Merged

asheth-eightfold merged 1 commit into
masterfrom
feat/asheth/eng-226364

Conversation

@asheth-eightfold

@asheth-eightfold asheth-eightfold commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A needs_sandbox on a PR that already carries the requested region's sandbox label now also dispatches sandbox.yml start. The label is left as it is, so the fleet sees no change.

Why: today a sandbox label left on with no sandbox behind it blocks every later needs_sandbox silently. That covers a start that failed before its pod reported, and a pod killed outright. The already_needs_sandbox check neither adds a label nor dispatches. The developer has no way back except commenting stop_sandbox first, which nothing tells them to do.

What vscode does with the dispatch (EightfoldAI/vscode#125494, launch_sandbox.start()):

  • The sandbox is still running (building, live, or rebuilding after a spot reclaim): it is left as it is. When the sandbox is live on CI k8s, the developer gets a reply: "A sandbox for this PR is already running: commit abc1234, live at <url> until 12:30 UTC. To start a new one, comment stop_sandbox first, then needs_sandbox again."
  • Nothing is running: a new sandbox starts.

This is the same rule shipit_k8s_request already follows: commenting again is how you ask again.

comment PR's labels before after
needs_sandbox none add sandbox, dispatch start same
needs_sandbox (also :2:taPwa, e2e_) sandbox nothing dispatch start (no label change)
needs_sandbox:ap sandbox :australia: nothing dispatch start ap (no label change)
needs_sandbox sandbox :australia: (another region) nothing same
needs_sandbox:eu none add sandbox :eu:, dispatch start eu same
any any, SANDBOX_K8S_TRIGGER false as before same (no dispatch)
stop_sandbox sandbox remove label, dispatch stop same

Testing

I ran entrypoint.sh on this branch and on master against event payloads for the 10 cases above, with a stub curl that records every call.

  • Result: the only difference is one added sandbox.yml start dispatch in the four "this region's label is already on" cases.
  • Every label call, which is everything the fleet sees, is identical. With SANDBOX_K8S_TRIGGER off, the two versions are identical in every case.
  • bash -n is clean.

The vscode side is tested in EightfoldAI/vscode#125494, on the CI k8s cluster as well as with unit tests.

Merge order

Merge EightfoldAI/vscode#125494 first, then this. vscode uses EightfoldAI/comment_actions@master, so this takes effect on every PR as soon as it merges. Merged first, it would send repeated needs_sandbox comments to today's launcher, which replaces a running sandbox.

JIRA: ENG-226364

🤖 Generated with Claude Code

…eady has that region's label (ENG-226364)

A needs_sandbox on a PR that already carries the requested region's sandbox label now
dispatches sandbox.yml start as well (the label is left as it is, so the fleet sees no
change). vscode's launcher decides from what is actually running (EightfoldAI/vscode#125494):
a sandbox still running is left as it is and, when live, the developer is told so
("comment stop_sandbox first"); a label left on with nothing behind it -- a start that
failed before its pod reported, a pod killed outright -- gets a new sandbox, instead of
blocking every later needs_sandbox as it does today. Another region's label still blocks
a new one, and nothing changes while SANDBOX_K8S_TRIGGER is off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@asheth-eightfold
asheth-eightfold merged commit ec1927b into master Nov 18, 2026
1 check passed
asheth-eightfold added a commit that referenced this pull request Nov 20, 2026
Conflicts in entrypoint.sh against #39 (start on needs_sandbox also when the label is on) and
#41 (stop_sandbox stops every region). Took master's structure and added dev to it:
- needs_sandbox:dev picks `sandbox 🧪` / region dev in master's wanted_label chain, so
  it gets #39's behaviour too;
- stop_sandbox removes `sandbox 🧪`; master's `stop all` already stops dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant