OmO pane loses its chat after its claude-sdk child exits: herdr drops the pi label and ignores OmO's reports
What happens
An OmO pane loses its chat and shows only the terminal after OmO's claude-sdk child has run and exited. herdr then lists the pane with no agent and agent_status: unknown, and it stays that way while OmO keeps running and holding its session. The chat lens is not offered, a notification can't open it, and the sidebar shows no agent. On 2026-10-28 two of four OmO panes in one workspace were in this state; the other two (no claude-sdk child recently) still read pi.
Why
- herdr does not recognize the
omobinary as Pi. The pane'spilabel comes only from theherdr:piintegration that OmO loads (~/.omo/agent/extensions/herdr-agent-state.ts). - While OmO's claude-sdk child runs, herdr detects the pane as Claude by process. When the child exits, herdr drops the agent (
agent changed pane=13 previous_agent=Some(Claude) agent=None pgid=Some(<omo pid>)in herdr-server.log). herdr:piis a full-lifecycle source, so herdr then suppresses its reports until it detects a Pi process again. It never does foromo. Every laterpane.report_agentfrom OmO, and a manual one with a freshseq, gets{"type":"ok"}but is not applied.- Ovis decides the chat lens from herdr's label (
selectedAgent !== nullinsrc/lib/usePaneLens.ts). The server already finds OmO by process, with no label:resolveTranscript→paneRunsOmo, andresolveAgentlets a found OmO outrankpi/claude. But the client never asks, because the label is null.
Reproduction (macOS, herdr 0.9.5, OmO 5.1.38–5.1.48)
- Run
omoin a herdr pane, and give it work that starts its claude-sdk child. - After the child exits and OmO is idle,
herdr pane listshows the pane with noagent,agent_status: unknown. Ovis shows only the terminal for it. herdr pane report-agent --source herdr:pi --agent pi --state idle --seq <now µs> <pane>returns ok and changes nothing.- Workaround:
/quit, thenomo --session <id>in the same pane. The new process's report is taken, and the pane readspiagain.
Proposed fix
In the pane snapshot the server sends, take a pane with no herdr agent label as omo when its foreground runs an OmO process that holds a session (the same check typingRoots / paneRunsOmo already use). The chat lens, alerts and sidebar would then follow it as they do for a labeled OmO pane. The herdr side (recognizing omo as Pi, or not suppressing herdr:pi when the process that exited was a different agent) could be raised with herdr separately.
Thanks for the detailed report and the herdr log line. I tried to reproduce this on current main (9faf067f) and could not reproduce the Ovis side, so I need a few facts from your machine before changing anything.
What I tested, in an isolated herdr session (herdr 0.9.5 on Linux, 0.9.3 on macOS): a pane whose foreground process is OmO, with herdr listing no agent and agent_status: unknown. That is the state your pane ends up in after the claude-sdk child exits (herdr also ignored the herdr:pi report there, as you describe). In both cases the snapshot Ovis serves (/api/session and the WebSocket snapshot) lists that pane as agent: "omo". Ovis looks up every pane's foreground processes whatever herdr calls the pane (omoPanes in server/omo.ts, applied by OmoStatus.apply), so herdr dropping its label should not by itself cost the chat or the sidebar row. CI's scripts/omo-plan-browser-regression.ts also drives an OmO pane that herdr never labels, through the sidebar and the chat.
So something on your machine stops Ovis from finding the OmO process in those panes. Could you capture these while a pane is in that state?
herdr pane process-info --pane <pane id>- That pane's
agentin the/api/sessionsnapshot (curl -s http://<ovis address>/api/session, with your token if one is set) - The Ovis version (Settings > About) and how you start OmO (the command, or the launcher if you use one)
If foreground_processes there does not list the OmO process, or lists it without its argv, that would explain it, and we can fix it from that fact.
Thanks, you were right that Ovis does not need herdr's label: the snapshot lists these panes as agent: "omo". What fails on my machine is the transcript behind them. Two more OmO panes reached the same state today (a MacBook Pro, Intel, connected to the Ovis server on a Windows PC as a remote PC; Ovis 0.4.19 with my own patches, none in server/omo.ts; OmO 5.1.48 started as omo or omo --session <id> in a zsh pane). I captured the facts before restarting them:
-
herdr pane process-info --pane w7:p3: two omo processes in the foreground group, the session holder last, both with argv:{"pid":45808,"argv":["/Users/…/.omo/binary-runtime/5.1.48/omo"],"name":"omo",…} {"pid":27726,"argv":["/Users/…/.omo/binary-runtime/5.1.48/omo","--session","01a172bb-…"],"name":"omo",…}w7:p1is the same, withomoalone on the holder's command line. -
The PC bridge's
/api/sessionlists both asagent: "omo",agent_status: "done". Its/api/pane/conversationreturns{"source":"scrollback","turns":[]}for both, so the chat is empty. RunningomoPanesfrom that bridge's ownserver/omo.tson the PC givespath: null, pending: nullfor both. -
The holder records exist, but their start times miss the 3 s
HOLDER_START_TOLERANCE_MS:pid holder processStartedAtMskernel start ( processStartedAt)difference 27715 (w7:p1) 1793082634000 1793082627042 +6958 ms 27726 (w7:p3) 1793082634000 1793082628690 +5310 ms OmO writes
floor(Date.now() - process.uptime() * 1000), and Bun'suptime()counts from runtime start, not from exec. Both processes started together, on a busy Intel Mac, so the runtime came up 5–7 s after exec. After a restart, the new holders differ by 1000 ms and the transcript resolves (omo-transcript, 20 and 29 turns). On an Apple Silicon iMac, four holders differ by 0–1000 ms.
So heldSessionIds drops the only evidence left once herdr no longer has the pane's session. While herdr still labels the pane pi, its session report covers for it, which is why my first report blamed the label.
A possible fix: accept a holder whose start is not earlier than the kernel's start and later by up to a larger bound (OmO's own value can only lag exec, never lead it), instead of ±3 s. I'll try that in my build and report back.
Follow-up: in my build, heldSessionIds now takes a holder whose start is up to 60 s later than the process's own start, and still drops one more than 3 s earlier (a reused pid's leftover). With that on the Intel Mac's bridge, the two held sessions resolve with a simulated 7 s lag and are dropped with a 5 s lead; server/omo.test.ts covers both. The diff is two lines in server/omo.ts (a HOLDER_START_LAG_MS = 60_000 bound beside HOLDER_START_TOLERANCE_MS). I can open it as a PR if that direction suits you.
Thanks for tracking this down to the holder start time. That analysis holds: this reproduces on current main (cbe3436d), so I'm keeping the issue open.
What I ran: two panes in an isolated herdr session (herdr 0.9.5, Linux). Neither pane has a herdr agent label. Each runs the same OmO stand-in, <bun> …/omo.js --session <id> (it takes the isOmoProcess path, as your omo --session <id> does). Each holds one session whose transcript has 2 turns. The panes differ only in the holder's processStartedAtMs: it is the kernel's start for that pid plus either 6958 ms (your w7:p1 measurement) or 1000 ms (your figure after a restart). I then queried a bridge built from main, started with port: 0.
| holder lag | heldSessionIds |
/api/session agent / status |
/api/pane/conversation |
|---|---|---|---|
| +6958 ms | [] |
omo / unknown |
source: "scrollback", 0 turns |
| +1000 ms | ["repro-2281-lag-1000"] |
omo / idle |
source: "omo-transcript", 2 turns |
So once a holder's start lags the kernel's start by more than 3 s, the pane is still omo but its chat is empty. The cause is server/omo.ts, where heldSessionIds applies HOLDER_START_TOLERANCE_MS = 3000 symmetrically (Math.abs(record.processStartedAtMs - startedAt) <= 3000). That catches a reused pid (whose holder start is earlier than the kernel's), but it also drops a holder that OmO wrote late because its runtime came up slowly. I did not reproduce the slow Bun startup itself on this machine; the lag comes from your measured values.
Minimal repro: save the script below as scripts/repro-2281.ts in a checkout and run bun scripts/repro-2281.ts. It uses only the isolated ovis-test herdr session and a mkdtemp root, and cleans both up afterwards. LAGS=3500,2500 shows where the 3 s boundary falls.
scripts/repro-2281.ts
/**
* Repro for devswha/ovis#2281: an OmO process whose own holder record says it started more than
* 3 s after the kernel's start for that pid (Bun's runtime came up late on a busy machine) loses
* its held session, so its pane's chat is empty. Two unlabeled panes in the isolated herdr test
* session, the same fixture, only the holder's lag differs (LAGS, default 6958,1000).
*/
import "./test-herdr.ts";
import { mkdirSync, mkdtempSync, rmSync, watch, writeFileSync } from "node:fs";
import { once } from "node:events";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { pathToFileURL } from "node:url";
import { createServer } from "../server/index.ts";
import { herdrRpc, workspaceClose, workspaceCreate } from "../server/herdr/client.ts";
import { heldSessionIds, omoSessionFolder } from "../server/omo.ts";
import { processStartedAt } from "../server/process-start.ts";
import { UsageService } from "../server/usage.ts";
const LAGS = (process.env.LAGS ?? "6958,1000").split(",").map(Number);
const root = mkdtempSync(join(tmpdir(), "repro-2281-"));
const store = join(root, "agent");
const quote = (w: string) => `'${w.replaceAll("'", "'\\''")}'`;
const workspaces: string[] = [];
let server: ReturnType<typeof createServer> | undefined;
const results: unknown[] = [];
try {
const panes: { lag: number; paneId: string; id: string; cwd: string; sessions: string }[] = [];
for (const lag of LAGS) {
const cwd = join(root, `project-lag-${lag}`);
const id = `repro-2281-lag-${lag}`;
const sessions = join(store, "sessions", omoSessionFolder(cwd));
mkdirSync(cwd, { recursive: true }); mkdirSync(sessions, { recursive: true });
const rows = [
{ type: "session", version: 3, id, cwd, timestamp: "2026-10-29T00:00:00.000Z" },
{ type: "message", id: "u1", parentId: null, message: { role: "user", content: [{ type: "text", text: "hello from #2281" }] } },
{ type: "message", id: "a1", parentId: "u1", message: { role: "assistant", stopReason: "stop", content: [{ type: "text", text: "held session answer" }] } },
];
writeFileSync(join(sessions, `2026-10-29T00-00-00-000Z_${id}.jsonl`), rows.map((r) => JSON.stringify(r)).join("\n") + "\n");
// argv as the reporter's: <runtime> .../omo --session <id> (isOmoProcess: the legacy path)
const bin = join(root, `bin-${lag}`); mkdirSync(bin);
const fixture = join(bin, "omo.js");
const ready = join(root, `ready-${lag}`); mkdirSync(ready);
writeFileSync(fixture, `import { mkdirSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { processStartedAt } from ${JSON.stringify(pathToFileURL(join(import.meta.dir, "../server/process-start.ts")).href)};
const dir = ${JSON.stringify(join(sessions, "session-holders", encodeURIComponent(id)))};
mkdirSync(dir, { recursive: true });
// what OmO writes: floor(Date.now() - uptime), here the kernel's start plus the runtime's measured lag
writeFileSync(join(dir, process.pid + ".json"), JSON.stringify({ pid: process.pid, processStartedAtMs: processStartedAt(process.pid) + ${lag}, cwd: ${JSON.stringify(cwd)} }));
writeFileSync(${JSON.stringify(join(ready, "held"))}, "");
setInterval(() => {}, 1000);
`);
const created = await workspaceCreate({ cwd, label: `repro-2281 lag ${lag}` });
workspaces.push(created.workspace.workspace_id);
const paneId = created.root_pane.pane_id;
const watcher = watch(ready);
try {
const up = once(watcher, "change", { signal: AbortSignal.timeout(20_000) });
await herdrRpc("pane.send_text", { pane_id: paneId, text: `export OMO_CODING_AGENT_DIR=${quote(store)}; cd ${quote(cwd)} && exec ${quote(process.execPath)} ${quote(fixture)} --session ${id}\n` });
await up;
} finally { watcher.close(); }
panes.push({ lag, paneId, id, cwd, sessions });
}
server = createServer({ port: 0, hostname: "127.0.0.1", token: "", stateDir: join(root, "state"), tailscaleOwner: null, usage: new UsageService(undefined, []) });
const origin = `http://127.0.0.1:${server.port}`;
const session: { snapshot: { panes: { pane_id: string; agent?: string | null; agent_status?: string }[] } } = await (await fetch(`${origin}/api/session`)).json();
for (const p of panes) {
const info: any = await herdrRpc("pane.process_info", { pane_id: p.paneId });
const omo = info?.process_info?.foreground_processes?.find((e: { argv?: string[] }) => e.argv?.some((w) => w.endsWith("/omo.js")));
const kernel = omo ? processStartedAt(omo.pid) : null;
const snap = session.snapshot.panes.find((x) => x.pane_id === p.paneId);
const conv = await (await fetch(`${origin}/api/pane/conversation?pane_id=${encodeURIComponent(p.paneId)}`)).json();
results.push({
lag_ms: p.lag, pane: p.paneId, omo_argv: omo?.argv, kernel_start: kernel,
held_ids: omo && kernel !== null ? heldSessionIds(p.sessions, omo.pid, kernel) : null,
snapshot_agent: snap?.agent, snapshot_status: snap?.agent_status,
conversation_source: conv.source, conversation_turns: Array.isArray(conv.turns) ? conv.turns.length : conv,
});
}
console.log(JSON.stringify(results, null, 2));
} finally {
try { server?.stop(true); } finally {
for (const w of workspaces) { try { await workspaceClose(w); } catch (e) { console.error("close failed", w, e); } }
rmSync(root, { recursive: true, force: true });
}
console.log("Cleanup: bridge stopped, workspaces closed:", workspaces.join(","), "fixture root removed:", root);
}
Thank you @Noobear: your measurements and root-cause analysis pointed straight at the fix, and you're credited in the changelog.
The fix is in https://github.com/devswha/ovis/pull/2424. A holder record may now start up to 60 s after the kernel's start for its pid, but only when its bootAtMs names this machine's boot. A reused pid's leftover, which always starts earlier, is still refused, and so is a record from another host or from before a clock step. Checked in an isolated herdr session with your measured lag (+6958 ms) and +3500 ms: the pane keeps its chat (omo-transcript, 2 turns), while a record 120 s late stays refused.