Visitar URL original
fix(sandbox): boot re-execs the script the bundle just installed, and a merge releases by saddlepaddle · Pull Request #7637 · ParadevAI/Paradev · GitHub
Skip to content

fix(sandbox): boot re-execs the script the bundle just installed, and a merge releases - #7637

Merged
saddlepaddle merged 2 commits into
mainfrom
sandbox-boot-reexec
Sep 24, 2026
Merged

saddlepaddle merged 2 commits into
mainfrom
sandbox-boot-reexec

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #7620/#7622/#7633. Two halves of one problem, found while trying to verify those in a real box.

The bundle moved; the image didn't

push: paths: packages/sandbox/bundle/**   → publish-bundle     (automatic)
workflow_dispatch: production-release     → image + goldens    (manual)

So the bundle was republished on every merge and the image only when someone remembered. Every new box booted an image older than the bundle it then fetched.

Which exposed a real bug

ensure_bundle installs the pinned bundle, then apply-rootfs copies its rootfs over /usr/local/bin/superset-boot. But the shell is still running the copy the image baked. The script already knew about half of this:

# apply-rootfs may have replaced the contract; re-read it.
. /etc/superset/contract.sh

It re-read the contract and not itself. So a bundle change to the boot script took effect on the boot after the one that installed it.

That is what I hit verifying #7620: the box received "baseBranch":"main" correctly, the new script's parsing was right in isolation, and the checkout log still showed the pre-change git clone --branch <working branch> — the old script ran, and the same repository was cloned twice. Boot now re-execs when apply-rootfs changed it, guarded by SUPERSET_BOOT_REEXEC so a script that never settles can't spin.

And closes the drift

production-release now also runs on a merge to main touching packages/sandbox/**, packages/host-service/** or packages/pty-daemon/** — the three that reach a box only through a release. The job's concurrency: sandbox-production-release already serialises, and GitHub collapses a burst of pending runs to the newest.

Not extended to TRIGGER_TYPE_RECURRING, which is worth considering separately: it's what the competing product uses alongside config-change to stop a snapshot drifting behind the repo when nothing about the environment itself changed.

Verified

  • bash -n on superset-boot; bun test packages/sandbox 9 pass / 0 fail; repo lint clean
  • The re-exec path itself is exercised by the first box that boots an image predating this bundle — which is the next release, and what I'll be watching in the boot log (boot.reexec).

Note

The job carries environment: production. If that GitHub environment has required reviewers, these automatic runs will wait for approval rather than proceeding — fine either way, but worth knowing which it is.


Summary by cubic

Fixes sandbox release drift and a boot race. Previously a merge to main republished the bundle while the image released only on manual dispatch, so a new box booted an image older than the bundle it fetched. The boot script also kept running the image's copy after apply-rootfs installed a new one, so a bundle change took effect one boot late.

  • production-release now triggers on a main merge touching packages/sandbox/** in addition to manual dispatch. packages/host-service/** is deliberately not included: a box picks host-service up by hash from bundle/assets.json, so what reaches a box is the version bump in that file, which is already a packages/sandbox/** change. The concurrency group serialises runs and GitHub collapses a burst of pending runs to the newest; the job carries environment: production, so automatic runs wait for approval if that environment has required reviewers.
  • Boot now re-execs into the script the bundle installed when its hash changed, once per boot via the SUPERSET_BOOT_REEXEC guard so a script that never settles can't spin. TRIGGER_TYPE_RECURRING was intentionally left out and is worth deciding separately.

Written for commit 92f2202. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Boot-time updates to the system startup process now take effect immediately, without requiring an additional reboot.
  • Chores

    • Sandbox-related changes are now included more reliably in automated release checks.
    • Production releases can now run automatically when changes reach the main branch, as well as through manual release requests.

… a merge releases

Two halves of one problem: the bundle moved on every merge to main while the
image and the goldens only moved when someone remembered, so a new box booted
an image older than the bundle it then fetched.

`apply-rootfs` replaces /usr/local/bin/superset-boot, but the shell is already
running the copy the image baked — the script re-read the contract afterwards
and not itself. A bundle's change to the boot script therefore took effect on
the boot *after* the one that installed it, which is how an older image's
checkout raced a newer bundle's and cloned the same repository twice. Boot now
re-execs when apply-rootfs changed it, once per boot.

The release job also runs on a merge that touches the sandbox, host-service or
pty-daemon, not only on dispatch. Those are the three that reach a box solely
through a release. The job's concurrency group already serialises runs, and
GitHub collapses a burst of pending ones.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9c11469e-e23e-42fa-b9e1-bb1460dd6837

📥 Commits

Reviewing files that changed from the base of the PR and between 1428795 and 92f2202.

📒 Files selected for processing (2)
  • .github/workflows/sandbox.yml
  • packages/sandbox/bundle/rootfs/usr/local/bin/superset-boot

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The sandbox workflow now covers all sandbox package changes and runs production releases on pushes to main. superset-boot detects replacement by apply-rootfs and re-executes the installed script once during boot.

Changes

Sandbox workflow updates

Layer / File(s) Summary
Workflow triggers and release conditions
.github/workflows/sandbox.yml
The pull-request filter includes all packages/sandbox/** changes. The production-release job runs on pushes to main and on matching manual dispatches from main.

Sandbox boot self-replacement

Layer / File(s) Summary
Boot script hash detection and re-execution
packages/sandbox/bundle/rootfs/usr/local/bin/superset-boot
The script records its initial SHA-256 hash before the passes run. If the hash changes and SUPERSET_BOOT_REEXEC is unset, it stamps boot.reexec, sets the guard, and re-executes itself once.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 92f22

The sandbox release and boot changes have no confirmed failure affecting production or developer workflows.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional commit format and accurately identifies both primary changes: boot-script re-execution and release triggering after merges. The wording is slightly awkward but remains clea…
Description check ✅ Passed The description explains the problem, implementation, scope decisions, testing, and production-environment consideration. It provides the required What & why and How I tested it information, but it do…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

host-service does not belong on it. A box picks host-service up by hash from
`bundle/assets.json` during sync-assets, so what actually reaches a box is
the version bump in that file — already a `packages/sandbox/**` change. A
host-service source merge changes nothing on any box, and firing a release on
one would rebuild the asset inside the release, leaving what boxes run adrift
from what the repo says they run.
@saddlepaddle

Copy link
Copy Markdown
Collaborator Author

Correcting the trigger: host-service and pty-daemon are off it, packages/sandbox/** only.

Satya pushed back and he's right. A box picks host-service up by hash from bundle/assets.json during the sync-assets pass — the row is versioned (1.29.0+bfc1ec72a) and fetched from the CDN when its hash differs. So what actually reaches a box is the version bump in that file, which is already a packages/sandbox/** change and already publishes. A host-service source merge changes nothing on any box.

Worse than unnecessary: firing a release on a host-service merge would rebuild the asset from source inside the release and rewrite assets.json there, so what boxes run would drift from what the committed file says they run. Fixed in 92f2202.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@saddlepaddle
saddlepaddle merged commit 8b40062 into main Sep 24, 2026
24 checks passed
@saddlepaddle
saddlepaddle deleted the sandbox-boot-reexec branch September 24, 2026 08:35
Kitenite added a commit that referenced this pull request Oct 1, 2026
* docs: weekly update for PRs merged 2026-09-23 to 2026-09-30

Source of truth: live Notion SOP "Weekly Docs Update (automation SOP)".
Window: merged:>=2026-09-23 (139 PRs). PRs through the morning of 09-23
were covered by #7771.

Changes
- Pages: no auto-open on publish (#7790); page links and URL links split
  into their own settings (#7916, #7962, #7946); Listening agents menu with
  per-row stop and Add listening agent (#7724, #7820, #7919); globe on the
  Share button (#7766); Report on public pages (#7886); agents offer a page
  (#7759). Files: pages.mdx, cli/cli-reference.mdx.
- Settings moves: Links replaced by Browser and Files & Editor (#7916,
  #7962). Files: editor.mdx, terminal-integration.mdx, customization.mdx.
- Editor: inline rename and drag to move (#7692), Auto Save (#7693, #7916),
  open and save files outside the workspace (#7897, #7982), Copy as Markdown
  (#7591), per-pane error screen (#7983). File: editor.mdx.
- Terminal copy follows Ghostty's whitespace rules (#7868).
  File: terminal-integration.mdx.
- Agents: UFO (#7898); GPT-6 Astra, Sonnet 5.5, retiring GPT-5.5, retired
  GPT-5.4/5.3 Codex (#7783, #7894, #7935). Files: agent-integration.mdx,
  cli/cli-reference.mdx.
- Host: superset start --daemon --auto-update and update-lock permission
  errors (#7735, #7952). Files: cli/host-server.mdx, cli/cli-reference.mdx.
- Removed the mcp CLI section and the Connected Service Plugins section:
  #7776 made plugins/mcp internal, the Plugins page is staff-flagged, and
  apps/docs/AGENTS.md keeps internal commands out. Files: skills.mdx,
  cli/cli-reference.mdx.
- Slack page unfurls and details panel (#7817, #7821, #7914, #7957).
  File: use-with-slack.mdx.
- Workspaces: instant creation with background naming (#7518); recoverable
  project deletion (#7896). File: workspaces.mdx.
- Shortcuts: prev/next workspace includes Pinned and wraps (#7851); ⌘B
  collapses the sidebar to a rail (#7964). File: keyboard-shortcuts.mdx.
- Ship controls and open-in button moved to the right sidebar strip (#7958).
  Files: diff-viewer.mdx, use-with-ide.mdx.

Deliberately skipped
- Cloud workspaces/environments/sandboxes (flag-gated, AGENTS.md rule):
  #7784 #7795 #7824 #7840 #7844 #7845 #7847 #7849 #7850 #7858 #7861 #7863
  #7874 #7911 #7913 #7918 #7922 #7931 #7932 #7937 #7956 #7961 #7969 #7981
  #7637 #7794 #7789 #7838 (its CLI docs already shipped in the PR).
- Staff-only plugins: #7912 Sentry plugin, #7716, #7727, #7955.
- Already documented in their own PRs: #7917, #7921.
- Removed feature never documented: #7796 Google Calendar triggers.
- Agents chip remove/revert/default-off, never documented: #7870 #7871 #7872.
- Billing/backend policy with no docs surface: #7947, #7812, #7786, #7792,
  #7798, #7761, #7948, #7949, #7951, #7827.
- Reverted security trio: #7828 #7829 #7830 (reverted by #7834).
- Fixes restoring expected behavior: #7683 #7696 #7707 #7743 #7751 #7756
  #7764 #7765 #7781 #7788 #7791 #7823 #7825 #7833 #7837 #7852 #7857 #7860
  #7864 #7865 #7869 #7873 #7897-covered #7903 #7938 #7980 #7943 #7964-chrome.
- Mobile (no docs page): #7746 #7747 #7748 #7749 #7750 #7782 #7793 #7810
  #7814 #7816 #7889 #7968.
- Marketing, internal docs, CI, version bumps: #7651 #7744 #7752 #7771 #7774
  #7776-infra #7777 #7785 #7811 #7818 #7822 #7826 #7834 #7884 #7885 #7895
  #7909 #7933 #7934 #7942 #7944 #7965 #7966.

Validation: bun run --cwd apps/docs typecheck, bun run lint:fix,
bun run lint (exit 0), Vale on 13 changed files (0 errors, 0 warnings),
git diff --check.

* chore: log weekly docs update follow-ups

* docs: tighten review findings in the weekly update

Only the page creator can stop or add listening agents. On focus change also
saves on window blur, and Auto Save pauses on conflicts. Taken-down pages do
not unfurl. Model picker coverage matches agent-models.ts.

This branch was previously deployed

1 inactive deployment
preview — 92f2202f Deployed Sep 18, 2026 by saddlepaddle via Deploy Admin #10047
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