Skip to content

fix(workspace): ship Python backend in the image, not the ConfigMap (fixes #430 + Mission Control 404)#431

Merged
imran31415 merged 1 commit into
mainfrom
fix/ship-python-backend-in-image
Jul 23, 2026
Merged

fix(workspace): ship Python backend in the image, not the ConfigMap (fixes #430 + Mission Control 404)#431
imran31415 merged 1 commit into
mainfrom
fix/ship-python-backend-in-image

Conversation

@imran31415

Copy link
Copy Markdown
Owner

Fixes #430. Also fixes the Mission Control /api/missioncontrol/queue 404 users see after updating.

Problem

The browser-config ConfigMap embedded the whole Python backend (server.py + memory/ skills/ adapters/ gateway.py mcp_*~992 KiB, 32 files) via {{ .Files.Get }}. As the code grew it crossed both 1 MiB limits:

  • the rendered ConfigMap object → ~1086 KiB (> the 1 MiB ConfigMap cap), and
  • the Helm release Secret (rendered manifest + bundled chart files) → ~1 MiB,

so helm upgrade began failing for every workspace:

Secret "sh.helm.release.v1.<ws>.vN" is invalid: data: Too long: may not be more than 1048576 bytes

That silently froze every workspace's ConfigMap-delivered server.py — self-serve/admin updates only ever patched the image, so a v1.41.1 image still ran a v1.40.1 server.py → no Mission Control → the 404. make ship/make deploy/self-serve reconcile were all blocked.

Fix — bake the backend into the image, drop it from the chart

  • devlaptop/Dockerfile: COPY server.py + memory/ skills/ adapters/ (+ top-level mcp_*/gateway/seed_*/harness/…) into /opt/browser-src.
  • start.sh: seed /tmp/browser + /home/dev/.claude-memory from /opt/browser-src (a cp -a tree copy) instead of unpacking flat /browser-config ConfigMap keys.
  • Delete browser-configmap.yaml; remove its mount/volume/checksum from the Deployment. Code changes now roll the pod via the image tag.
  • .helmignore the backend .py so Helm stops bundling it into the chart — this is what actually shrinks the release Secret. Packaged chart: ~1 MB → 64 KiB.

Consequence (deliberate)

Backend changes now ship via an image rebuild (a release), not a config-only make ship-config. Every release already rebuilds the image — and this also kills the recurring "image updated but backend stale" bug class (#240/#307/#319/#430): an image update now delivers backend code by construction.

Verification

  • helm lint clean; 106 helm unittests green (2 updated for the new /opt/browser-src path); helm template renders with no browser-config ConfigMap/mount/volume.
  • Local COPY+seed simulation: server, hypervisor_session, gateway, mcp_*, and the memory/skills/adapters packages all import cleanly, and server.py contains the api/missioncontrol route.
  • Packaged chart shrank from ~1 MB to 64 KiB → release Secret comfortably under 1 MiB.
  • CI's Docker Build Smoke Test builds the full amd64 image with the new COPY (final gate).

After merge

Cut a release; workspaces can helm upgrade again and self-serve/fleet updates deliver the current server.py — Mission Control appears and the 404 is gone.

🤖 Generated with Claude Code

…ap (#430)

The workspace `browser-config` ConfigMap embedded the entire Python backend
(server.py + memory/skills/adapters/gateway/mcp_* — ~992 KiB across 32 files)
via `{{ .Files.Get }}`. As the code grew it crossed BOTH 1 MiB limits:
  - the rendered ConfigMap object hit ~1086 KiB (> 1 MiB ConfigMap cap), and
  - the Helm release Secret (rendered manifest + bundled chart files) hit ~1 MiB,
so `helm upgrade` started failing for every workspace:
    Secret "sh.helm.release.v1.<ws>.vN" ... Too long: may not be more than 1048576 bytes
This silently froze every workspace's ConfigMap-delivered server.py — self-serve
updates only patched the *image*, so e.g. a v1.41.1 image still ran a v1.40.1
server.py (no Mission Control -> /api/missioncontrol/queue 404).

Fix — bake the backend into the image and drop it from the chart:
  - devlaptop/Dockerfile: COPY server.py + memory/ skills/ adapters/ (+ the
    top-level mcp_*/gateway/seed_*/harness/etc.) into /opt/browser-src.
  - start.sh: seed /tmp/browser and /home/dev/.claude-memory from /opt/browser-src
    (a `cp -a` tree copy) instead of unpacking flat /browser-config ConfigMap keys.
  - Delete templates/browser-configmap.yaml; remove its mount/volume/checksum
    from the Deployment. Code changes now roll the pod via the image tag.
  - .helmignore the backend .py so Helm no longer bundles it into the chart —
    this is what actually shrinks the release Secret. Packaged chart: ~1 MB -> 64 KiB.

Consequence: backend changes ship via an image rebuild (a release), not a
config-only `make ship-config`. Every release already rebuilds the image, so this
also fixes the long-standing "image updated but backend stale" class of bug —
an image update now delivers backend code.

Verified: helm lint clean; 106 helm unittests green (2 updated for the new path);
`helm template` renders with no browser-config ConfigMap/mount; a local
COPY+seed simulation imports server/hypervisor_session/gateway/mcp_*/memory/
skills/adapters cleanly and confirms the missioncontrol route is present.
@imran31415
imran31415 merged commit d16ce9f into main Jul 23, 2026
7 checks passed
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.

Workspace Helm release exceeds 1 MiB Secret limit — blocks all helm upgrades (fleet + self-serve)

1 participant