Repository navigation
Description
Describe the bug
Viewing an omp session that ompweb did not start (for example one run in the background by another agent, or in a terminal) is very hard to follow:
- The whole current turn is folded into a single
Process details · N messages · M tool callsrow, so it looks as if nothing is happening. - If you expand that row to follow along, it collapses again as soon as the session writes its next assistant message.
Both come from components/ChatWindow.tsx (checked at ae59ec6):
- Live tail only for ompweb's own runs.
isLiveTail(line 460) is(sessionBusy || isStreaming) && row.endIndex === messages.length && row.userIndex === lastAnchorIdx.sessionBusycomes fromagentRunning, which is set by events from ompweb's own RPC process, andGET /api/agent/[id]answers{ running: false }whenevergetRpcSession(id)has no live process (app/api/agent/[id]/route.ts:82-84). A session driven by another omp process is therefore never treated as live, and its current turn is always folded. - Group key changes with every new message. The group row is keyed
`process-group-${userIdx}-${finalAssistantIdx}`(line 531).finalAssistantIdxis the latest assistant message of the turn, so each new assistant message changes the key. React then remountsProcessDetailsGroupand itsuseState(false)(line 184) resetsexpanded. FeedingplanTranscriptRowsa growing turn (prompt, then assistant text + tool call, then tool result, repeated) gives keys0-1,0-3,0-5,0-7in turn.
To reproduce
- Start an omp session outside ompweb, e.g.
ompin a terminal, or a background agent that drives omp, and give it a task that makes several tool calls. - Open ompweb and select that session in the sidebar.
- The current turn shows as one
Process detailsrow. Expand it. - Wait for the next assistant message; the row collapses.
Expected behavior
The current turn of a session that is still being written stays readable, as it does for a turn ompweb is running itself. An expanded group stays expanded while the turn continues.
Suggested fix
- Key the group by its anchor only:
key={`process-group-${userIdx}`}.userIdxis already unique per row, so the expanded state survives new messages. - Treat the newest turn as the live tail whether or not ompweb owns the process. Either drop the
(sessionBusy || isStreaming)condition, or also accept "the session file changed recently". Alternatively add an "Expand process details by default" setting next to "Keep tool calls collapsed".
We are running the first two changes as a local patch against 0.5.0's built output. With them, a background session's current turn renders flat and updates live, and an expanded older group stays expanded while new messages arrive. We checked this in Chrome against a session being written by a separate omp process. Happy to open a PR if you'd like one.
Environment
- OS: CachyOS (Arch-based), kernel 7.2.7
- Node.js version: v26.10.0
- omp version: 18.3.0
- Browser: Chrome
- omp-web version: 0.5.0 (source references are to
mainatae59ec6)
Additional context
This is the main way to watch non-interactive omp sessions that another tool starts, so the folding hides exactly the sessions you'd open ompweb to watch.
Activity
fix: address six reported issues in one batch
kahme247 commentedon Oct 2, 2026
Fixed in
acf20c0f.The collapse — already fixed upstream, deliberately not changed again. Your key
process-group-${userIdx}-${finalAssistantIdx}is gone; currentmainkeys activity segments asactivity-${userIdx}-${segmentIdx}. I wanted to be sure before leaving it alone, so I ran the realplanTranscriptRowsover a turn that grows message by message and compared candidate keys: the current one loses nothing and produces no duplicates as text and activity segments insert and merge. The alternative I had planned, keying on the first piece's message index, was actively wrong — it produced duplicate keys (activity-0-4twice,activity-0-6three times). So the remount-resets-useState(false)path is gone because the key stopped moving, not because we papered over it. If you still see a group collapse on currentmain, that is a different trigger and I would want the transcript that shows it.The folded current turn — fixed.
sessionBusy = agentRunning || bashRunningis only ever true for a process omp-web itself spawned, so a session you drive from anotherompbinary could never get a live tail, and its newest turn was permanently folded into "Process details".looksLikeRunningTurn()reads the transcript tail instead: atoolResulttail is running, an assistant turn is running while its last non-blank block is atoolCall, and a turn that has stopped, aborted or errored is not. The hook exposes that asexternalRunActiveand polls the session file every 2s while it holds — the transcript is how you learn a foreign process moved — backing off once the transcript has been still for 60s, and waking up again if it grows.isLiveTailnow ORs it in.One deliberate limit:
sessionBusyitself is unchanged. It gates fork, navigate, autoscroll and abort-handler registration, so widening it would have handed the Stop button to a run omp-web does not own. Only the live-tail decision reads the new signal. That also means no "expand process details by default" setting yet — this keeps the newest turn open without forcing every group open, which is the part I would want your read on before adding it.