Spaces:
Sleeping

polats Claude Opus 5 (1M context) commited on
Commit
a38523f
·
1 Parent(s): caf011b

Keep the server alive across a restart, and persist its state

Browse files

The hook was launching the server and losing it: the log file appeared, empty,
and nothing listened. It runs under /bin/sh by default, where the detach does not
hold and the process goes when the hook returns — a codespace that looks healthy
and serves nothing. Running it through bash -c fixes it, which is why that wrapper
is there rather than for quoting.

Verified across a full stop/start cycle: the hook fires again on resume, opencode
is serving within seconds, and from outside the codespace an anonymous request is
still refused while a request carrying the user's GitHub token and the basic auth
password returns a healthy 200.

Also creates the state root. entrypoint.sh only uses it when it already exists and
is writable, and nothing else made it, so every boot reported "persistence: NONE"
and would have dropped sessions and provider logins at the next idle stop — the
one thing a stopped codespace is otherwise supposed to keep.

Drops the diagnostics that found this; the log the entrypoint already writes is
enough now that the failure is understood.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

2 files changed +11 -5
Files changed (2)
.devcontainer/devcontainer.json+6-5
.devcontainer/start-opencode.sh+5