OMP in code-server — surviving reloads and running AFK
A browser reload of cdsr.loca.zone is not a job lifecycle event, but two of the three OMP surfaces in this IDE behave as if it were. This page says which surface to use for which job and gives the exact commands.
Pick the surface by job
| Job | Surface | Survives page reload | Survives cdsr restart |
|---|---|---|---|
| short interactive task | ACP panel (ACP: New Conversation → Oh My Pi) | no — panel loses its binding to the omp acp child; the transcript in ~/.omp/agent/sessions survives | no |
plain omp in the integrated terminal | integrated terminal | usually reattaches, but the terminal is owned by the IDE session and can be dropped | no |
| long interactive session | omp inside tmux | yes | yes |
| bounded unattended (AFK) work | omp -p detached under tmux or a supervisor | yes | yes |
Rule of thumb: ACP is a view, not an owner. Anything you would walk away from must run under tmux or a supervisor, never as a child of the panel or the IDE terminal.
Interactive: tmux
tmux new-session -As omp -c /home/loca/dev/<project>
ompAfter a reload, or from any other terminal / ssh session:
tmux attach -t ompTranscript persistence is separate from process persistence. tmux keeps the running process; OMP keeps the conversation:
omp --continue # most recent session for this directory
omp --resume <id-prefix> # a specific one; omit the value for a pickerIf a panel or terminal session died mid-turn, omp --continue in the same directory recovers the conversation, not the interrupted tool call.
AFK: detached print mode
tmux new-session -d -s afk -c /home/loca/dev/<project> \
omp -p --auto-approve --max-time 90m \
"Complete <task>. Verify it. Report exact files changed and results."-ddetaches immediately;tmux attach -t afkshows progress,tmux capture-pane -pt afkreads it without attaching--auto-approveis mandatory: print mode has no approval UI, so without it the first tool call blocks forever--max-timebounds a runaway run-pbuffers output until exit, so a quiet pane is not a hang; checkps -o etime,time -p <pid>and file mtimes instead- run it in a git worktree or a scoped repo: an auto-approved OMP runs as
loca, which holdsNOPASSWD: ALL
From inside an OMP session, the equivalent is the hub supervisor, and it has the same PTY requirement (next section):
hub op:start name:afk application:/home/loca/.local/bin/omp
args:["-p","--auto-approve","--max-time","90m","<prompt>"]
cwd:/home/loca/dev/<project> pty:true ready:{log:".",timeout:120}The pipe-stdin trap
omp decides how to take its prompt from whether stdin is a TTY. When stdin is a pipe or /dev/null, it prints
Reading prompt from piped stdin (waiting for EOF; ctrl+c to abort)…
Still starting after 10s — phase: readPipedInputignores the argv prompt entirely, and waits for EOF. Reproduced on this host with omp --help from a non-TTY tool shell on 2026-09-03: even --help sat in readPipedInput until killed. Consequences:
- every unattended launch must have a PTY:
tmuxprovides one;hub op:startneedspty:true; a barenohup omp -p … &or a systemd unit without a tty will hang while looking healthy - a healthy launch shows
Working...in its first lines, neverReading prompt from piped stdin - if you must feed the prompt through a pipe, send it on stdin and close it; do not also pass it as an argument
ACP panel: what actually persists
omp acpis a child of the ACP client extension inside the remote extension host. Reloading the page recreates the webview; the extension may dispose the child or keep it alive with no client attached. Either way the conversation card is gone- the transcript is safe:
session/listreads~/.omp/agent/sessions, so the agents tree lists prior sessions after a reload andomp --continuein a terminal reaches the same file - a tool call that was mid-flight when the reload happened is not resumed by anyone
- one
omp acpprocess serves several panel sessions, but a CLIompis always a separate process sharing~/.omp
Not yet true, do not assume
- there is no daemon that owns ACP runs and lets a reloaded page reattach to a running turn
- there is no completion notification for a detached run; poll the tmux pane or read the session transcript
code-serverrestart (sudo -n systemctl restart cdsr) kills the extension host and every integrated terminal; onlytmuxand supervisor-owned processes survive it
Related: private page (sign-in required) for the ACP wiring and its security notes, private page (sign-in required) step 7b for the panel smoke test.