Repository navigation
feat(chat): show the session's work time, transcript size and goal in the header (#2017) - #2909
Conversation
… the header (#2017) The header's crumb line, from 769px, now says how long the selected chat's agent has worked (the sum of its turns' recorded durations; 'at least' until the chat has loaded back to the beginning), the transcript file's size, and the omo goal's status. The More menu's header repeats them in full, with the goal's objective, at every width. The newest conversation page carries transcript_bytes, the size of the file it was read from (a Codex rollout, a Claude/pi/omp/omo/gjc session file); stores that are not one file leave it out and the menu says the size is unknown. A Codex goal, kept in Codex's own state store, is not read.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…at least when a span is unknown Two views of one pane (both halves of a split on the same tab) each publish their own totals; one leaving no longer clears the other's. A settled agent turn without a recorded span makes the sum 'at least' instead of an exact total.
|
Review round 1 (omo + Codex Terra xhigh at 825742f), fixed in e4da547:
Not changed:
Validation after the fix: |
|
Re-review (omo + Codex Terra xhigh) at 1935358: CLEAR, no HIGH or MEDIUM. LOW notes left as they are:
|
|
Local merge gate (owner-approved): reviewed head (omo CLEAR, threads resolved) with |
…econnect regression (#2937) ## Summary `scripts/reconnect-header-demo-regression.ts` fails on main (reproduced on `ea3b07fa`): ``` error: innerText: Error: strict mode violation: locator('.context-sub') resolved to 2 elements: 1) <div class="context-sub">…</div> 2) <div class="context-sub context-session" title="Worked 1m · Transcript size unknown">…</div> ``` #2909 added the session line (`.context-sub.context-session`) under the pane title, so the regression's crumb locator now matches two elements. The product is right: the session line is a second row that `App.tsx` already hides while the connection word (`Reconnecting…` / `Connected`) has the crumb's place. Only the test's locator was too broad, so this PR narrows it to the crumb: `.context-sub:not(.context-session)`. No product code changes. ## Validation - `bun scripts/reconnect-header-demo-regression.ts`: failed before (strict mode violation above), passes after: `PASS 390`, `PASS 412`, `PASS 1280`. - `bun run check fast`: passed (workflow syntax, generated types/themes, typecheck, build, unit tests: 11869 pass, 0 fail, 46 skip) - Skipped: `bun run check full` (test-only change to a single browser script; CI's Integration and browser job runs it).
…#3077) Part of #1170 ## What OmO's chat now shows two things only its TUI showed, read only from what OmO records in its session file: 1. **Goal continues** (proposal 1). OmO starts a turn to continue an active goal with a `goal-continuation` custom message (`display: false`). The chat used to show that turn like any other assistant turn. It now gets a quiet divider in the user's seat, like a compaction or a runtime notice: `Goal continues · <time>`. Opening the divider shows the goal's objective, taken from the message's `<untrusted_objective>` block and unescaped as OmO writes it. 2. **The goal waits on background work** (proposal 3). OmO writes `goal-cache-warmup` `{phase: "scheduled", dueAtMs, wakeSources}` when the goal waits on background work, and `resumed` when it goes on. While a `scheduled` wait is the last thing in the conversation, the chat ends with one line: `⌛ Goal waits on 1 task, 1 monitor, and 2 terminals · continues around 07:20`. The counts come from `wakeSources`: `senpi-task` is tasks, `terminal-monitors` monitors, `terminal-background-sessions` terminals, `omo-dag` DAG runs, `senpi-codemode` code cells; OmO's wake queue is left out. With no counts the line says "background work". - The server drops the line when `resumed` arrives, when an `engine-turn-start` record shows OmO starting any turn (a wake, a monitor event, the continuation), or when any later record adds a turn. A newer `scheduled` replaces it, so the conversation never holds more than one. - The client hides the line one minute after its due time, so an OmO that exited mid-wait cannot leave it on screen for good. Proposal 2 (keep the goal visible across turns) already shipped in #2909: the header and the More menu show the latest goal. Proposal 4 (the live ▰ progress bar) needs OmO to expose goal state, so it is not part of this PR. ### Where - `server/transcript-records.ts`: `omoGoalContinuation` and `omoGoalWait`, and the omp/OmO parser keeps a goal's wait only as its last turn (`state.wait`), the same record by record in previews and in one-shot parses. - `shared/protocol.ts`: a new `goal_wait` conversation part (`due_at`, `waiting_on`). The continuation reuses `notice` with `source: "goal-continuation"`. - `src/components/ChatView.tsx` and `.css`: the "Goal continues" label and the wait line. - `src/lib/panePresentation.ts`: a trailing wait does not hide the answer before it, so the finish still counts as seen. `src/lib/chatMinimap.ts`: a wait gets no minimap tick. - Korean, Japanese and Chinese strings. ### Design reference This follows OmO's own TUI: its `goal continues` line and its background-work marker. The look reuses the chat's own quiet compaction/notice divider. Like the Codex app's thread goal, the goal's state appears where the conversation is read, not in a separate panel. No new setting: the lines show transcript facts on OmO panes, as the "Background task ended" cards already do. Nothing changes on other agents. ## Screenshots Demo fixtures (the cli-tools pane) with a continuation and a wait added, the continuation opened: | | light | dark | |---|---|---| | 390 | <img src="https://raw.githubusercontent.com/devswha/ovis/a79ff46bbd99067b191149cc64a04b6ece07c737/goal-en-390-light.png" width="260"> | <img src="https://raw.githubusercontent.com/devswha/ovis/a79ff46bbd99067b191149cc64a04b6ece07c737/goal-en-390-dark.png" width="260"> | | 1280 | <img src="https://raw.githubusercontent.com/devswha/ovis/a79ff46bbd99067b191149cc64a04b6ece07c737/goal-en-1280-light.png" width="420"> | <img src="https://raw.githubusercontent.com/devswha/ovis/a79ff46bbd99067b191149cc64a04b6ece07c737/goal-en-1280-dark.png" width="420"> | | 390 Korean | <img src="https://raw.githubusercontent.com/devswha/ovis/a79ff46bbd99067b191149cc64a04b6ece07c737/goal-ko-390-light.png" width="260"> | <img src="https://raw.githubusercontent.com/devswha/ovis/a79ff46bbd99067b191149cc64a04b6ece07c737/goal-ko-390-dark.png" width="260"> | ## Validation - Failing first on origin/main: `server/conversation.test.ts` "OmO goal continuation and waits" (2 tests), `server/omp-incremental.test.ts` "a goal's wait is withdrawn the same way record by record…", `src/lib/goals.test.ts` (new helpers), `src/lib/panePresentation.test.ts` (the finish counts as seen after a trailing wait; fails without the `panePresentation.ts` change). - A real OmO session file (a lane run on 2026-10-28) parses to 67 "Goal continues" dividers, and none of its scheduled waits are left over at the end. - `bun scripts/chat-working-line-demo-regression.ts`: PASS (8 checks). - `bun run check fast`: ok (typecheck, build, unit tests 12420 pass / 0 fail). - Not run: the full integration and browser suites (CI runs them).
Fixes #2017
What
The selected chat's session totals, read-only and per pane, updated as turns arrive:
transcript_bytes, a new optional field on the newestGET /api/pane/conversationpage. It is the size of the file that page was read from (a Codex rollout, or a Claude/pi/omp/omo/gjc/agy session file), taken from thestatthe read already does. Older pages and stores that are not one file (OpenCode, Devin, Hermes, dsh) leave it out, and the menu says Transcript size unknown.create_goal/update_goal/get_goal) left in the loaded turns, cleared by a later{"goal": null}(reuseslib/goals.ts).Where:
Worked 1h 22m · 12 MB, plus a Target glyph with the goal's status. It is its own flex item after the crumb, so it wraps out of sight before the crumb does (checked at 800/960/1100: the title and crumb are unchanged). It gives the line to the Reconnecting/Connected word. Its tooltip has the full text.Goal: objective · status · time. A phone's header line belongs to the title, so this is where a phone reads them (the issue's "or the pane's ⋯ menu when the header is full").Design reference: the Codex desktop app shows a thread's active goal next to its title. Ovis puts it on the crumb line because the header is one line (DESIGN.md, Header context).
No new storage, no polling: the size comes with the read the chat already makes, and the times and goal come from turns it already holds.
Not included
goals_1.sqlite,thread_goals), not in the rollout. Reading a versioned internal database is a maintenance cost, and the issue leaves that decision open. This PR ships the metrics plus omo goals only.Screenshots (demo fixtures; the conversation answer was enriched in the page with turn times, a size and an omo goal call)
Before:
Tests
server/conversation.test.ts: the newest page'stranscript_bytesequals the file's size and follows an append; an older page has none. It failed before the change (undefined).src/lib/sessionStats.test.ts: it sums the recorded spans and skips unknown or backwards ones; it reports no work time before any span; it passes on completeness and size; the goal is the latest across turns and is cleared by a later null. It failed before the change (module missing).Validation
bun run check fast: pass (workflow syntax, generated types/themes, typecheck, build, unit tests 11665 pass / 0 fail).bun run check integration browser/full(CI runs them).This changes an HTTP response (one additional optional field), so it waits for a real review.