-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Context
A production Claude Code workspace (claude-code-wild-daisy) got stuck in Provisioning because it was created with the Claude Code image but without the Claude Code preset env. The live Spritz resource had no spec.env and no spritz.sh/preset-id=claude-code, so the Claude Code ACP health endpoint returned 503 due to missing ANTHROPIC_API_KEY.
This appears to come from the UI create flow, not the runtime itself.
Likely root cause
The create form currently treats a preset as "still selected" only when the image field exactly matches the preset image.
Relevant code:
ui/src/create-form-state.tsui/src/preset-panel.tsui/src/create-form-request.ts
That is brittle for digest-pinned preset images. If a preset image changes across deploys, previously persisted form state can silently fall out of preset mode even when the user still intends to create from that preset.
When that happens, submit falls back to sending raw spec.image instead of presetId, which drops preset-derived env like ANTHROPIC_API_KEY.
Repro
- Open the Spritz UI and select a preset like Claude Code.
- Persist the form state in local storage.
- Deploy a new Spritz version where that preset points to a new image digest.
- Reopen the UI with the persisted state.
- Submit the form without explicitly reselecting the preset.
Observed
- The request can be submitted with
spec.imageinstead ofpresetId. - The created workspace does not inherit preset env.
- For Claude Code, the workspace stays stuck in
Provisioningbecause the ACP health check fails withoutANTHROPIC_API_KEY.
Expected
Preset selection should be anchored to a stable preset identity, not exact image equality.
Acceptance criteria
- Persist a stable preset identifier in create-form state.
- Restore preset selection by stable preset identity, not exact image equality.
- Use
presetIdon submit whenever the form is still in preset mode. - Only fall back to raw
spec.imagewhen the user explicitly switches to custom or intentionally edits away from the preset. - Add regression tests covering persisted preset state across preset image digest changes.