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

JobSurfaceSurvives page reloadSurvives cdsr restart
short interactive taskACP panel (ACP: New Conversation → Oh My Pi)no — panel loses its binding to the omp acp child; the transcript in ~/.omp/agent/sessions survivesno
plain omp in the integrated terminalintegrated terminalusually reattaches, but the terminal is owned by the IDE session and can be droppedno
long interactive sessionomp inside tmuxyesyes
bounded unattended (AFK) workomp -p detached under tmux or a supervisoryesyes

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>
omp

After a reload, or from any other terminal / ssh session:

tmux attach -t omp

Transcript 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 picker

If 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."
  • -d detaches immediately; tmux attach -t afk shows progress, tmux capture-pane -pt afk reads it without attaching
  • --auto-approve is mandatory: print mode has no approval UI, so without it the first tool call blocks forever
  • --max-time bounds a runaway run
  • -p buffers output until exit, so a quiet pane is not a hang; check ps -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 holds NOPASSWD: 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: readPipedInput

ignores 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: tmux provides one; hub op:start needs pty:true; a bare nohup omp -p … & or a systemd unit without a tty will hang while looking healthy
  • a healthy launch shows Working... in its first lines, never Reading 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 acp is 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/list reads ~/.omp/agent/sessions, so the agents tree lists prior sessions after a reload and omp --continue in a terminal reaches the same file
  • a tool call that was mid-flight when the reload happened is not resumed by anyone
  • one omp acp process serves several panel sessions, but a CLI omp is 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-server restart (sudo -n systemctl restart cdsr) kills the extension host and every integrated terminal; only tmux and 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.