Skip to content

chore(sandbox): drop the ts/go daemon switch, Go is the only implementation - #5569

Merged
pedrofrxncx merged 1 commit into
mainfrom
chore/sandbox-drop-daemon-impl-switch
Aug 2, 2026
Merged

chore(sandbox): drop the ts/go daemon switch, Go is the only implementation#5569
pedrofrxncx merged 1 commit into
mainfrom
chore/sandbox-drop-daemon-impl-switch

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Teardown #1 of the Go rollout scaffolding, on top of #5568 (now merged — Go is the default).

Once Go is the only daemon, every lever that let a sandbox be TS is dead weight. Removed end to end:

Removed Was
apps/api/src/sandbox/resolve-daemon-impl.ts (+test) prop → org flag → default resolution
sandbox_go_daemon in OrgFlagsSchema per-org opt-out
SANDBOX_START's daemonImpl input per-sandbox pin
SandboxDaemonImpl / sandboxDaemonImplSchema / EnsureOptions.daemonImpl the type itself
resolveClaimTemplate + claim-template.test.ts which template a claim names
readClaimDaemonImpl, LABEL_KEYS.daemonImpl the studio.decocms.com/daemon-impl label
STUDIO_SANDBOX_GO_TEMPLATE_NAME / goSandboxTemplateName the global kill switch
chart daemonImpl, goTemplate.*, image.goRepository the twin-template machinery

image.repository now points at studio-sandbox-go and the chart renders one SandboxTemplate and one SandboxWarmPool again — back to the pre-canary shape, with the other binary.

Two things reviewers should push on

1. The daemon_impl metric attribute is gone. It was the Go-vs-TS comparison dimension on every sandbox metric (tenantAttrs), plus the matching pod label. With one implementation it's a constant, but any Grafana panel filtering or splitting on daemon_impl breaks on deploy — those filters need removing. I did not touch dashboards; flagging rather than silently leaving a constant dimension.

2. Deploy order is load-bearing. This deletes studio-sandbox-<env>-go and flips the surviving template's image TS→Go (which rolls the warm pool). The API must ship first — it's the side that stops naming the -go template. Sync the chart before the API and in-flight claims reference a template that no longer exists. Chart 0.9.67 → 0.10.0, with the hazard written into the Chart.yaml upgrade note.

The matching CD change (drop goTemplate, collapse back to one KEDA ScaledObject, drop STUDIO_SANDBOX_GO_TEMPLATE_NAME) is a follow-up in decocms/deco-apps-cd and must sync after this deploys.

Testing

  • bun test apps/api/src/sandbox apps/api/src/tools/sandbox packages/sandbox/server — 267 pass. Deleted the three SANDBOX_START daemon-impl cases and the whole claim-template.test.ts (its only subject was the removed function); dropped the now-unused orgFlags knob from the SANDBOX_START test harness.
  • helm template + helm lint on sandbox-env: one SandboxTemplate, one SandboxWarmPool, image studio-sandbox-go, 0 failures.
  • bun run --cwd <ws> check clean for apps/api, packages/sandbox, packages/shared. knip clean — no orphans left behind.
  • Pre-existing and NOT from this branch: bun run check:readmes fails on a missing apps/mesh/package.json (fails on main too), and apps/web has ~20 react-resizable-panels type errors from dependency drift.

Next in the series

Separate PRs, each revertable on its own: remove the desktop link feature, then delete packages/sandbox/daemon (extracting the org-fs sidecar and the Go conformance suite first).


Summary by cubic

Make Go the only sandbox daemon and remove the TS/Go switch across Studio and the Helm chart. The chart now renders one template and warm pool using studio-sandbox-go, and metrics no longer include daemon_impl.

  • Refactors

    • Removed daemonImpl from SANDBOX_START, the sandbox_go_daemon org flag, and the claim label/resolve logic.
    • Dropped SandboxDaemonImpl types and related tests.
    • Deleted dual-template machinery; image.repository points to studio-sandbox-go.
    • Removed daemon_impl metric/label from runner and tenant attrs.
  • Migration

    • Update Grafana dashboards: remove any filters/splits on daemon_impl.
    • Deploy order: ship API first (it stops naming the -go template), then sync deploy/helm/sandbox-env 0.10.0; this flips the default image and deletes studio-sandbox-<env>-go.
    • Follow up in decocms/deco-apps-cd: collapse back to one KEDA ScaledObject and drop STUDIO_SANDBOX_GO_TEMPLATE_NAME after this deploy.

Written for commit 0d051ef. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 18 files

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="deploy/helm/sandbox-env/values.yaml">

<violation number="1" location="deploy/helm/sandbox-env/values.yaml:44">
P2: The documented kind deployment still runs the TS daemon because its overlay and reload script explicitly select the bare `studio-sandbox` image, so this Go-only default is not applied to local validation. Updating the kind overlay/build command to use `studio-sandbox-go` and the Dockerfile's `go` target would keep the supported environment consistent.</violation>

<violation number="2" location="deploy/helm/sandbox-env/values.yaml:44">
P1: A chart release can now point at a missing Go image because the sandbox image release gate checks only the legacy TS repository before skipping both builds. Checking the Go manifest as well, or building/publishing the Go image independently when its tag is missing, would prevent production pods from becoming unpullable.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

goRepository: ghcr.io/decocms/studio/studio-sandbox-go
# The Go sandbox daemon. The daemon implementation IS the image — there is no
# runtime switch, so a pod cannot disagree with the template that created it.
repository: ghcr.io/decocms/studio/studio-sandbox-go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: A chart release can now point at a missing Go image because the sandbox image release gate checks only the legacy TS repository before skipping both builds. Checking the Go manifest as well, or building/publishing the Go image independently when its tag is missing, would prevent production pods from becoming unpullable.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At deploy/helm/sandbox-env/values.yaml, line 44:

<comment>A chart release can now point at a missing Go image because the sandbox image release gate checks only the legacy TS repository before skipping both builds. Checking the Go manifest as well, or building/publishing the Go image independently when its tag is missing, would prevent production pods from becoming unpullable.</comment>

<file context>
@@ -39,10 +39,9 @@ envName: ""
-  goRepository: ghcr.io/decocms/studio/studio-sandbox-go
+  # The Go sandbox daemon. The daemon implementation IS the image — there is no
+  # runtime switch, so a pod cannot disagree with the template that created it.
+  repository: ghcr.io/decocms/studio/studio-sandbox-go
   # Pinned to a specific version so chart upgrades pull a matching image
   # instead of silently moving with `:latest`. Bump in lockstep with
</file context>

goRepository: ghcr.io/decocms/studio/studio-sandbox-go
# The Go sandbox daemon. The daemon implementation IS the image — there is no
# runtime switch, so a pod cannot disagree with the template that created it.
repository: ghcr.io/decocms/studio/studio-sandbox-go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The documented kind deployment still runs the TS daemon because its overlay and reload script explicitly select the bare studio-sandbox image, so this Go-only default is not applied to local validation. Updating the kind overlay/build command to use studio-sandbox-go and the Dockerfile's go target would keep the supported environment consistent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At deploy/helm/sandbox-env/values.yaml, line 44:

<comment>The documented kind deployment still runs the TS daemon because its overlay and reload script explicitly select the bare `studio-sandbox` image, so this Go-only default is not applied to local validation. Updating the kind overlay/build command to use `studio-sandbox-go` and the Dockerfile's `go` target would keep the supported environment consistent.</comment>

<file context>
@@ -39,10 +39,9 @@ envName: ""
-  goRepository: ghcr.io/decocms/studio/studio-sandbox-go
+  # The Go sandbox daemon. The daemon implementation IS the image — there is no
+  # runtime switch, so a pod cannot disagree with the template that created it.
+  repository: ghcr.io/decocms/studio/studio-sandbox-go
   # Pinned to a specific version so chart upgrades pull a matching image
   # instead of silently moving with `:latest`. Bump in lockstep with
</file context>

@pedrofrxncx
pedrofrxncx merged commit 0a55500 into main Aug 2, 2026
29 checks passed
@pedrofrxncx
pedrofrxncx deleted the chore/sandbox-drop-daemon-impl-switch branch August 2, 2026 18:09
decocms Bot pushed a commit that referenced this pull request Aug 2, 2026
PR: #5569 chore(sandbox): drop the ts/go daemon switch, Go is the only implementation
Bump type: patch

- decocms (apps/api/package.json): 4.160.0 -> 4.160.1
- @decocms/native (apps/native/package.json): 4.160.0 -> 4.160.1
- @decocms/sandbox (packages/sandbox/package.json): 1.35.1 -> 1.35.2
- @decocms/shared (packages/shared/package.json): 0.13.0 -> 0.13.1
- deploy/helm/sandbox-env (chart 0.10.1) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.35.2

Deploy-Scope: server
pedrofrxncx added a commit that referenced this pull request Aug 3, 2026
The Go daemon has been the implementation every sandbox claims since #5484/
#5569; the TS daemon was still building, still shipping in a second image and
still claiming half the docs. Delete it (~24k lines) and keep only what is not
the daemon:

- `daemon-e2e/` — the black-box HTTP/SSE conformance suite, moved out of the
  implementation it used to live inside. Its default target is now
  `daemon-go/bin/daemon` instead of the TS bundle; `DAEMON_E2E_CMD` still
  swaps in any other binary.
- `orgfs/` — the org-fs client/WebDAV plus the privileged mounter sidecar,
  which is its own image and stays TypeScript. Dead `detachMount` (the sync
  twin, only reachable from the deleted daemon's exit hook) removed with it.
- `daemon-protocol.ts` — the config + SSE wire types Studio's daemon client and
  web UI consume, previously reached into the daemon source.

One image, one daemon: the Dockerfile's `ts`/`go` targets collapse into a
single stage and `studio-sandbox-go` is the only image published — the
`studio-sandbox` name is frozen at 1.35.3 (its last TS tag) and stays pullable
for rollback. The image also drops the node-pty install that existed only
because the TS bundle marked it external.

CI: the two daemon-e2e jobs become one (Go, keeping the `daemon-e2e` job name),
docker-smoke builds and boots one image, and daemon-e2e-windows.yml — a gate on
a subtree that no longer exists — is deleted.

Docs say Go: sandbox README rewritten (it still described the Bun daemon and
the removed desktop link), a README for daemon-go, CONTRIBUTING rule #4 and
AGENTS gotcha #8 rewritten, and every `packages/sandbox/daemon/...` pointer in
the Rust local-api parity comments repointed at its Go or daemon-e2e successor.

Co-authored-by: Pedro França <pedrofrxncx@deco.cx>
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