Relationships
#4754 swamp start: Codex can run swamp inside its sandbox, and a 421 names --trusted-hosts
Opened by skunk-ape · 11/14/2026· Shipped 11/14/2026
Found in an external tester's Swampify run. Affects every swamp start user who launches Codex, and anyone reaching start or the dashboard through a reverse proxy. Related: #4753 (launch and resume fixes) and #4751 (launch targets).
Repo: swamp (swamp start's Codex launch, and the start and local dashboard servers' host check).
1. Codex launched by start can't run swamp in its sandbox
What happened
Start launched Codex on a Swampify kick-off in a new workspace. Codex's first swamp command failed inside its sandbox with ERR_SQLITE_ERROR while opening the local catalog (DatabaseSync). Codex then asked to run swamp extension pull outside the sandbox, the request was cancelled, and the run stalled. The tester only got past it by running the brief through another agent app.
Likely cause
Codex's default sandbox lets commands write only in the working folder. The workspace's own catalogs live inside it, but swamp also writes under its home directory (~/.swamp, or SWAMP_HOME), for example the per-repo cache under repos/<id> and the Deno cache used to bundle extensions. Find which path failed first.
Change
- When start launches or resumes Codex (task, open and resume), pass the directories swamp needs to write as extra writable roots with Codex's
--add-dir <dir>: swamp's home directory, and any other path the investigation shows. Keep the trust override as it is. - Windows takes the same flag if its launcher can carry it. If it can't, say so in the design doc.
- Document it in
design/surfaces/start.md: what start widens in Codex's sandbox, and why. - Check whether Claude Code launched by start has the same problem (its sandbox is off by default). If it does, fix it the same way. If it doesn't, say so in the PR.
2. A 421 names its fix
What happened
The tester exposed swamp start to their phone through tailscale serve. Every request through the proxy got 421 Misdirected request, because the Host header wasn't trusted. Their agent found --trusted-hosts only by comparing Host headers with curl, then started a second instance with it.
Change
- In the start server and the local dashboard server, the 421 body says which host was refused and how to allow it: start (or
swamp dashboard) with--trusted-hosts <host>. It never echoes anything other than the host name, length-capped. - Log the refusal once per host at warning level in the terminal running the server, with the same hint.
Out of scope
- Making start listen beyond localhost, or setting up Tailscale.
- Resume targeting and the terminal list (#4753).
Done when
- Unit tests cover Codex's launch, open and resume args with the extra writable roots,
SWAMP_HOMEset and unset, and Windows. - A manual run: start launches Codex on a kick-off in a new workspace, and Codex runs
swamp extension pullandswamp behavior createinside its default sandbox without asking to leave it. - Unit tests cover the 421 body and the once-per-host warning for both servers, including a long or odd Host header.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.