Skip to content

OmO panes never read RUN: herdr reports claude/idle and sends no status, so READY/DONE, the held queue and done alerts are wrong #286

Closed

Description

@devswha

What happened

An OmO pane reads READY or DONE in the sidebar and composer while the agent is working, and never reads RUN. Nothing changes when a turn starts, when it ends, or while OmO's background tasks run and later wake the session by themselves.

Three live OmO panes were watched for about three minutes, read-only and once a second: session.snapshot, a pane.agent_status_changed subscription for every pane, pane.read of the visible screen, and GET /api/session.

What was read Result
Screen all three panes went back and forth between ── • Working (8s • esc to interrupt) ── / ── • Running eval (47s • esc to interrupt) ── and the resting prompt, several times each
herdr agent / agent_status claude / idle in every sample
pane.agent_status_changed frames 0
GET /api/session omo / done for two panes, omo / idle for the third, unchanged; never working

One of the panes had a background task child running for 21 minutes. Its main turn ended and started again by itself during the watch, and nothing changed anywhere.

Excerpt of the watch log (one row per change; raw is herdr, served is GET /api/session, fg is the screen's status line, bg counts task rows reading · running ·):

{"t":"20:38:23.160","k":"sub-started","panes":["w2W9:p1","w2WD:p1","w2WE:p1","w2WG:p1"]}
{"t":"20:38:23.262","k":"state","pane":"w2W9:p1","raw":"claude/idle","served":"omo/done","fg":"• Running eval (• esc to interrupt)","bg":1}
{"t":"20:38:23.268","k":"state","pane":"w2WE:p1","raw":"claude/idle","served":"omo/idle","fg":"• Working (• esc to interrupt)","bg":0}
{"t":"20:38:53.860","k":"state","pane":"w2WE:p1","raw":"claude/idle","served":"omo/idle","fg":null,"bg":0}
{"t":"20:38:57.918","k":"state","pane":"w2WG:p1","raw":"claude/idle","served":"omo/done","fg":"• Working (• esc to interrupt)","bg":0}
{"t":"20:40:59.014","k":"state","pane":"w2W9:p1","raw":"claude/idle","served":"omo/done","fg":"• Working (• esc to interrupt)","bg":0}

Environment and frequency

  • Observed on 2026-10-02 KST.
  • herdr web ui 0.3.40, revision ef900557aa725845dfea1013b468538baf20b2d4, managed installation. All links below point at that revision.
  • herdr 0.9.0, protocol 22. OmO 5.1.7 (engine senpi 2026.9.30). Linux x86_64.
  • Every OmO pane, every turn: 3 of 3 panes, 0 status frames in the watch.
  • The last working version is unknown. The header of server/completion.ts records that OmO 5.0 still produced pi/working → claude/unknown → claude/idle.

Confirmed cause

1. herdr sends no status for an OmO pane

  • agent.get for an OmO pane answers agent: "claude", agent_status: "idle" and no agent_session while the screen shows Running eval. The subscription delivers nothing.
  • pane.process_info lists two foreground processes: bun …/omo-ai/node_modules/@code-yeongyu/senpi/dist/bundle/cli.js --extension …/omo-ai/plugin and OmO's SDK child claude.
  • OmO starts that child as claude --output-format stream-json --input-format stream-json … --setting-sources= --permission-mode dontAsk … --resume=<id> --fork-session …. With --setting-sources= empty the user's Claude settings are not loaded, so herdr's Claude hook (~/.claude/hooks/herdr-agent-state.sh, registered for SessionStart only) never runs in it. The child is started anew between requests: its pid changed during the watch.
  • herdr integration status reports pi: not installed, and herdr has no OmO integration.
  • Not established: why herdr settles on idle rather than unknown. That is inside herdr.

2. The server has no other source of status

Status reaches the browser from herdr only:

CompletionTracker.settle turns an idle that follows work into done and keeps it until the pane works again or herdr's focus moves onto it (seen). With no later frame, done stays. Fed the sequence from the file's header, an in-memory new CompletionTracker(null) gives:

pi/working -> working | claude/unknown -> working | claude/idle -> done
every later snapshot with claude/idle -> done, done, done
a pane that never worked, claude/idle -> idle

The installation's completions.json held "finishedAgents": {"w2W9:p1":"claude","w2WG:p1":"claude"} for the two panes that read DONE, so an idle after work under the claude identity did happen once in each. That it happened at session start is inferred from the header comment; it was not observed in this watch.

3. Nothing reads OmO's own state

What the user sees

  • Sidebar, palette, composer: an OmO pane never reads RUN (STATUS_WORD, Composer.tsx).
  • Held queue and Stop: a message sent while OmO works is sent at once instead of being held, and there is no Stop. Both need agentStatus === "working" (PaneTerminal.tsx L1029, L1056).
  • Chat: the running turn is not shown as live (isLiveWorkTurn), and statusEdgeRead never asks for an immediate read. The 2 s poll still runs.
  • Alerts: no done alert when a turn really ends, in the browser or by web push (shared/notify-policy.ts, server/push.ts). If the inference above holds, one DONE appears shortly after the session starts, while the agent is still working.
  • DONE that stays: it clears only when herdr's focus moves onto the pane. A pane herdr already had focused (w2W9:p1) read DONE throughout.
  • Background work: a main turn that ended while task children, monitors or background terminal sessions are still running looks the same as a session with nothing left to do, and the turn those wake later is not shown either.

What OmO records that a fix can read

All of this was read from live OmO 5.1.7 sessions. What was not verified is marked.

Which session a pane holds (already resolved)

omoTranscriptForPane finds the pane's session file through heldSessionIds: ~/.omo/agent/sessions/<cwd slug>/session-holders/<session id>/<pid>.json holds {"pid","bootAtMs","processStartedAtMs","cwd"} for the OmO process that pane.process_info names.

Whether the main turn is running: the session .jsonl

~/.omo/agent/sessions/<cwd slug>/<timestamp>_<session id>.jsonl, one entry per line:

{"type":"message","id":"…","parentId":"…","timestamp":"…","message":{"role":"user",…}}
{"type":"message",…,"message":{"role":"assistant","stopReason":"toolUse","content":[{"type":"thinking"},{"type":"toolCall"}]}}
{"type":"message",…,"message":{"role":"toolResult","toolCallId":"…","toolName":"eval"}}
{"type":"message",…,"message":{"role":"assistant","stopReason":"stop",…}}
{"type":"custom","customType":"senpi.hooks.stop-state",…}
{"type":"custom_message","customType":"omo-senpi:wake","display":false,"content":"task completion name:… status:completed …"}
  • An assistant entry is appended when that message is complete. While a tool runs, the last message entry is the assistant one with stopReason: "toolUse"; the toolResult entry follows when the tool returns.
  • stopReason over the three largest sessions: toolUse 562, stop 119, error 25, aborted 1.
  • A turn often starts with no user entry. Of 143 turns that followed a finished one, 39 began with a user entry and 104 with an assistant entry, started by a custom_message: a finished background task (omo-senpi:wake), a monitor (senpi-monitor:notification), a background terminal session (senpi-terminal:notification), goal-continuation, senpi.todo-owed. A rule of "working when the last entry is user or toolResult" misses the first request of those turns.
  • After a finished assistant message come bookkeeping custom entries (senpi.hooks.stop-state, goal-cache-warmup, omo-memory:accepted-turns, omo-memory:projection-pin). They do not start a turn. custom claude-sdk-oauth-binding is written a few milliseconds before each assistant entry, so it is no start signal either.
  • stopReason: "error" is not always the end: 8 of the 25 were followed by senpi.hooks.stop-state and a goal-continuation message, and the session went on.
  • Not verified: the full list of custom_message types that start a turn. Some are attached to a turn that is already running (omo-kibitzer:recall, environment-context), and omo-memory:notice may be written with no turn at all. Check each type against a live OmO before treating it as a start.
  • The files are large (3.5 MB seen): read the tail, not the whole file.

Background children: the task records

<cwd>/.omo/senpi-task/tasks/st_*.json, one per task child:

{"task_id":"st_01a0f91c","status":"running","residency_state":"resident","parent_session_id":"01a0f88b-…","root_session_id":"01a0f88b-…","depth":1,"execution_mode":"process","created_at":"…","started_at":"…","updated_at":"…","name":"…","task_summary":"…","category":"deep-low"}
  • Seen status: running, completed, cancelled. Seen residency_state: resident, rpc_detached, disposed. Other fields include terminal_at, host_pid, owner, notification.
  • parent_session_id is the session id in the .jsonl name, so running children can be counted per pane.
  • A record goes from completed back to running when the child is resumed.
  • Not verified: whether a session that crashed leaves running records behind. Check host_pid / owner before counting a record as live.
  • Monitors and background terminal sessions (◉ watching 3: … in the footer) are not in these records. No file for them was found; not searched for exhaustively.

The screen, as a fallback only

  • Main turn: the divider above the prompt reads ── • Working (8s • esc to interrupt) ── or ── • Running eval (47s • esc to interrupt) ──, and is a plain rule at rest.
  • Children: one footer row each, ⠹ <summary> · category:… · turn 5 (8 tools) · … · running · 21m.
  • esc to interrupt anywhere on the screen is not enough: the watch matched the phrase inside conversation text. Anchor on the divider line.
  • terminal_title is not usable: one working pane read OmO - Running eval, another OmO - <session title> - <cwd>.
  • An OmO layout change breaks this. server/prompt.ts already reads OmO's question forms from the screen, which may be the way to blocked; not looked into here.

Suggested direction

Derive the status of an OmO pane in the server from OmO's own records, and feed it through the path every other agent's status already takes, so the client needs no change for RUN, the held queue, the live turn and alerts.

Part A, the bug: RUN / DONE for the main turn. Working while a turn runs, done when it ends, from the session .jsonl of the session the pane holds.

Part B, background work: needs a maintainer decision first. What a pane reads when its main turn has ended and children are still running. Recommended: DONE (the agent did answer, and the done alert belongs at that moment) plus a count of running background tasks next to it, rather than RUN for the whole time. A count is a new field on the wire. Part A does not depend on this and can ship alone.

Things that will go wrong if missed

  1. Snapshots undo a status that only went through observe. CompletionTracker.project (called by readSnapshot) settles every pane from the raw snapshot's agent_status on every read. herdr keeps saying claude/idle, so a derived working becomes done at the next GET /api/session. The derived status has to replace herdr's for an OmO pane before the tracker sees it, on every path: status events, snapshots, and the collector's onBaseline / onResync that seed and resync web push.
  2. Identity. The tracker drops a finish when the agent changes (finishedAgent !== agent), and matches on herdr's raw identity, not the omo display label (test: "matches finished raw identities before applying an omo display label"). herdr has named an OmO pane both pi and claude. Give the derived status one stable identity.
  3. Nothing arrives to trigger a read. herdr sends no frame for these panes, so the server has to notice the file changing: a watch on the session file or a bounded poll, only for panes that run OmO, and running with no browser connected, since web push depends on it. labelOmoPanes already costs one pane.process_info per candidate pane per snapshot; do not add a second probe per pane per read.
  4. Remote PCs. server/machines.ts keeps its own tracker, and the session files are on the remote PC. Derive where the files are (the bridge runs the same server code). A change to bridge code needs REMOTE_BUNDLE_VERSION in shared/machines.ts bumped.
  5. No mtime guessing. server/omo.ts never picks a session by recency ("tool activity is not evidence of pane ownership"). Read entries of the session the pane holds; a pane whose session cannot be resolved (two OmO panes in one cwd on a system without /proc, for instance) keeps herdr's status.
  6. seen stays. A DONE still clears when herdr's focus moves onto the pane.
  7. Web push timing. done: "long" alerts only after a turn that worked longTurn or more (server/push.ts), measured between the working and done it is given. A turn woken by a background task must count as its own turn.

Constraints

Acceptance criteria

Part A:

  • An OmO pane reads RUN within about 2 s of a turn starting, whether a user message or a wake (omo-senpi:wake, a monitor, a background terminal session) started it, and stays RUN through tool calls.
  • It reads DONE when the turn ends, and a pane-status frame and a web push alert go out then, under the same rules as other agents.
  • GET /api/session, the WS snapshot and pane-status frames agree; repeated snapshots do not turn a working OmO pane into DONE.
  • No DONE shortly after an OmO session starts while its first turn is still running.
  • A message sent from the composer while OmO works goes to the held queue, and Stop is offered.
  • DONE survives a restart of the server, as it does today, and a turn that was running at the restart reads RUN again after it.
  • A turn that ended in stopReason: "error" and was continued by OmO does not alert as done in between.
  • Other agents' statuses are unchanged; existing tests in server/completion.test.ts, server/collector.test.ts and server/push.test.ts pass unmodified, or with changes that are explained.

Part B, once decided:

  • A pane whose main turn ended while children run shows that children are running, and how many, from the task records of the session it holds.
  • A running record left by a dead process is not counted.

Tests

  • Pure logic (entries → status, task records → count) as unit tests beside server/omo.test.ts and server/completion.test.ts, with entry fixtures taken from the shapes above.
  • Anything that needs live herdr goes in a *.contract.test.ts; server/omo.contract.test.ts already runs a stand-in OmO process in a pane and writes a session store under a temp home.
  • No fixed sleeps: wait for the frame or the file change with a bounded deadline.

Reproduction

  1. Start OmO 5.1.7 in a herdr 0.9.0 pane and give it a task that takes a minute or more.
  2. While its screen shows ── • Working (… esc to interrupt) ──, read curl -s localhost:7317/api/session | jq '.snapshot.panes[] | {pane_id, agent, agent_status}': the pane reads omo with idle or done.
  3. Subscribe to pane.agent_status_changed for the pane and let the turn end and another start: no frame arrives.
  4. In the app the pane reads READY or DONE the whole time, and a message sent from the composer during the turn is not held.

Activity

  1. added
    bug
    on Oct 1, 2026
  2. added a commit that references this issue on Oct 2, 2026
    9119a39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions