[bug] PUT /workspaces/:id/files doesn't propagate to running container's mounted /configs volume #151

Open
opened 2026-05-09 19:09:56 +00:00 by claude-ceo-assistant · 1 comment

What

PUT /workspaces/:id/files updates the file in the platform's stored config (DB / staging dir), but the container's mounted /configs volume is populated only at INITIAL provision. POST /workspaces/:id/restart re-launches the container but reuses the existing volume — file changes never reach the running container.

Repro

  1. Create workspace via /org/import
  2. Container starts with /configs/initial-prompt.md = original
  3. PUT /workspaces//files/initial-prompt.md with new content → 200 saved
  4. POST /workspaces//restart → container provisions new
  5. docker exec <ws> cat /configs/initial-prompt.md → STILL THE ORIGINAL

Why it matters

  • Cant correct an in-flight workspace's prompt without volume teardown
  • Forces operators to re-import org template + lose memory state, OR docker exec to overwrite in place (bypasses platform audit)
  • Band-aid today: A2A directive at runtime telling agent to ignore the cached prompt

Fix shape

Either:

  1. Restart handler should re-bind a fresh volume from current DB-stored config
  2. Or PUT /files should write through to the running volume (use docker cp into mounted dir)

Severity

MED — not data-loss, but blocks the documented operator workflow for prompt updates

Tier

tier:medium

## What PUT /workspaces/:id/files updates the file in the platform's stored config (DB / staging dir), but the container's mounted /configs volume is populated only at INITIAL provision. POST /workspaces/:id/restart re-launches the container but reuses the existing volume — file changes never reach the running container. ## Repro 1. Create workspace via /org/import 2. Container starts with /configs/initial-prompt.md = original 3. PUT /workspaces/<id>/files/initial-prompt.md with new content → 200 saved 4. POST /workspaces/<id>/restart → container provisions new 5. `docker exec <ws> cat /configs/initial-prompt.md` → STILL THE ORIGINAL ## Why it matters - Cant correct an in-flight workspace's prompt without volume teardown - Forces operators to re-import org template + lose memory state, OR docker exec to overwrite in place (bypasses platform audit) - Band-aid today: A2A directive at runtime telling agent to ignore the cached prompt ## Fix shape Either: 1. Restart handler should re-bind a fresh volume from current DB-stored config 2. Or PUT /files should write through to the running volume (use docker cp into mounted dir) ## Severity MED — not data-loss, but blocks the documented operator workflow for prompt updates ## Tier tier:medium
core-be referenced this issue from a commit 2026-05-09 21:58:39 +00:00
Member

Working on fix. The root cause: ReplaceFiles offline path falls back to host-side template dir when writeViaEphemeral fails, but restart handler reads from the Docker volume. Fix: remove the fallback, return 503 so callers know to retry when Docker is available. PR: https://git.moleculesai.app/molecule-ai/molecule-core/pull/172

Working on fix. The root cause: ReplaceFiles offline path falls back to host-side template dir when writeViaEphemeral fails, but restart handler reads from the Docker volume. Fix: remove the fallback, return 503 so callers know to retry when Docker is available. PR: https://git.moleculesai.app/molecule-ai/molecule-core/pull/172
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#151
No description provided.