Chats page — calls, instances and delegates, the header's working members, system chats (analyses, builder and project chats), the run waterfall. A repository rule for apps/ui/src/renderer/chats/call-*, apps/ui/src/renderer/chats/use-call-*, apps/ui/src/renderer/chats/use-recent-call-messages*, apps/ui/src/renderer/chats/working-agent*, apps/ui/src/renderer/chats/working-card-parts*, apps/ui/src/renderer/chats/conversation-work*, apps/ui/src/renderer/chats/agent-instances*, apps/ui/src/render...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rule Ui Chats Calls?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/geniro-io-rule-ui-chats-calls)
---
name: rule-ui-chats-calls
description: "Chats page — calls, instances and delegates, the header's working members, system chats (analyses, builder and project chats), the run waterfall. A repository rule for apps/ui/src/renderer/chats/call-*, apps/ui/src/renderer/chats/use-call-*, apps/ui/src/renderer/chats/use-recent-call-messages*, apps/ui/src/renderer/chats/working-agent*, apps/ui/src/renderer/chats/working-card-parts*, apps/ui/src/renderer/chats/conversation-work*, apps/ui/src/renderer/chats/agent-instances*, apps/ui/src/renderer/chats/subagent-*, apps/ui/src/renderer/chats/use-delegate-pages*, apps/ui/src/renderer/chats/transcript-groups*, apps/ui/src/renderer/chats/durable-transcript*, apps/ui/src/renderer/chats/prompt-cache*, apps/ui/src/renderer/chats/tool-kind*, apps/ui/src/renderer/chats/agents-panel*, apps/ui/src/renderer/chats/system-chat*, apps/ui/src/renderer/chats/before-send-guards*, apps/ui/src/renderer/chats/use-followed-chat*, apps/ui/src/renderer/chats/analyze-thread-dialog*, apps/ui/src/renderer/chats/use-thread-analysis*, apps/ui/src/renderer/chats/hosted-chat-dock*, apps/ui/src/renderer/chats/run-waterfall*, apps/ui/src/renderer/chats/use-run-waterfall*; read it before editing a file there."
---
<!-- GENERATED by scripts/sync-agent-rules.mjs from .claude/rules/ui-chats-calls.md. DO NOT EDIT: edit the source, then run `pnpm sync:agent-rules`. -->
# Chats — calls, system chats and the run waterfall
**Calls, instances and delegates:**
- A team run's agents come from the run's snapshot (`GET /v1/teams/runs/:runId/team`), never the library. The new-run trigger chip is the exception.
- A call waiting under its run's active-turn cap reads `queued`, never running — on its row of the Team activity block and in the inspector's Agents tab (`CallBlockEntry.queued`, folded from the executor's `queuedCall` row; its first status row ends it; off the page, run state's `RunCallState.queued`). `queued` is unsettled and is not working.
- A call continuing an earlier call's `thread` is the same instance.
- A call a callee made is drawn as a card inside its caller's card, never in the run's own flow: the claim pass files it under the call its `inCall` names, else under the newest call of its `callerConversationId` chain (`parentCallOf`, twin of the daemon's), and the parent's status, result and readings are read from its own rows only (`CallShell.nested`). Both surfaces resolve chains through `resolveCallChains` and match through `callIds`. A root page never carries such a call's rows, so a folded caller card holds no card for it: a callee of a call run state reads as running whose card is not in the window draws no live or working row (`withLiveText`'s `daemonOpenCalls`, from `runningCallCallees`); its Team activity row narrates it.
- Who works is the thread header's member avatars (`chats/chat-header.tsx`, decision `working-agents = header`): one face per member, a working one ringed in the working colour, a press opening the inspector's Agents tab. In a team run the composer shelf also carries the Agents chip (`chats/working-agents-chip.tsx`, decision `working-agents`, user decision 2026-12-02, bringing back what the floating card of #448 showed and #752 removed): a round face of the lead working agent with the live count, whose panel lists every current run (face, name, its work chips, state, elapsed, last messages) over a fold of the finished, a press opening that run's `call-conversation-dialog.tsx`. There is no floating working-agents card. Calls are rows of ONE Team activity block in the transcript (decision `calls-view = rows`), never a card per call; a shut row states the callee's context ring, its figure and the spend after its clock (`CallContextFigures` in the row's `headerAction`, outside its toggle); a row expands in place: the brief as `BlockRequest` ("Providing instructions for <callee>"), the callee's newest three steps of any kind, one line each (`CallSteps`: a message as it is, a reasoning row by its first line, a tool call by the transcript's own `formatToolName` + `toolCallSummary`; never a tool result, a delegate's row or a person's; open while the call works, folded under "Latest steps" once a result stands, user decision «Последние шаги» 2026-12-04), `BlockResult` ("Result from <callee>") once the call has a result, the last step dropped when it is a message equal to the result (user decision: the input and result blocks back), nested calls as rows, sub-agents as collapsed `SubagentBlock`s, a message box to the callee, its figures and its Show the whole conversation opens `call-conversation-dialog.tsx`: its own rows, read through `use-call-pages.ts` (the loader the opened cards use too) and folded by `useDurableTranscript`, so a call off the window is read without moving the window; a call the callee made from that conversation is drawn as a card inside it, and its live rows are taken too (`callsInside`). The callee's newest steps are read from `GET /v1/chats/:runId/calls/:callId/messages?steps=true` (`use-recent-call-messages.ts`, `steps`; the Agents chip's panel reads the messages alone), never a page of the conversation.
- Never pool every instance's work into one list. Rows are filed by `callId`. Content whose call is not loaded becomes an inferred instance.
- A main conversation exists only when there is a `status` row with no `callId`. Never infer one by counting turns.
- Never time a wait from the agent's last row.
- The call-message queue is keyed by call block id, because call ids restart per pass. It retries only `CALL_MESSAGE_REFUSED`. A message row (`role === 'user'`) is never the block's summary or result.
- The prompt-cache badge threshold is a twin of the daemon's `CACHE_EXPIRED` rule, pinned by a spec.
- A call card's line, its shut band, its tasks chip and the inspector's instance row read the callee's own thread (`callBlockActivity`, `callBlockSummary`, `callBlockTasks`), never a sub-agent's: several run at once, each with its own card.
- With no tool of its own running, or once its turn ended, a callee with sub-agents out reads the still `<member> is waiting for N sub-agents` (`callBlockSubagentsRunning`): its blocks in the window as each reads, plus the delegates the daemon says run in this conversation with no block there (`offWindowSubagents`, laid on by `applyDaemonReadings`). A shut band showing the callee's words carries it as a chip beside them. A held turn writes no row, so that card stays `running`; `waiting` needs the turn's terminal row.
- One thread's sub-agents are listed in one order everywhere (`orderSubagentThreads`: running, then unfinished, then finished; launch order inside each group), and each row states what its block measured (`SubagentFacts`: type and model; time, ticking from the launch while it runs, else the CLI's own duration; tokens processed; tool calls; cost — a figure nothing measured is not drawn), read through `subagentFiguresView` like the transcript's card. The shelf chip's list and an agent's conversation section draw the one `SubagentRow`; the Agents tab's Sub-agents section keeps its inspector row and draws the same facts line under it, and shows its running rows before any "Show N more".
- A delegate's generic title is its id tail. `resultIsOwn` is decided structurally, never by matching a CLI's prose. A `SendMessage` is not a delegation (`isAgentToolName`).
- Shells listed in the panel are the main thread's only, dropped at the item (`subagentIdOf`).
**System chats** (`system-chat.ts`, `system-chat-actions.tsx`, `before-send-guards.tsx`, `use-followed-chat.ts`, `use-thread-analysis.ts`; user decision: they open as ordinary chats, not popups or docks):
- A thread's, a team's or the system analysis, a team builder chat and a project chat are ordinary threads of the Chats screen, told apart by `RunDto.systemKind` (`isSystemChat`). The screen lists them with `includeSystem: 'true'` (the listing, its older pages, `takeInRun`'s and `useThreadArchived`'s `readRunById`); no other reader passes it. They are drawn in one **System** section after every group and the loose list (`runGroupSections`), whatever group they name: it folds to Show all and pins like any section, takes no drop and its rows never move into a group (`handleDropInSection`). A row names its kind (`SYSTEM_CHAT_LABELS`, the `system-kind` badge) and offers no Analyze or Reflect. The command center's manager stays a hosted dock, and lessons reflections are never listed.
- The open system chat's header says "System · <kind>" and carries a chip back to what it is about (`systemSourceOf`): the analysed thread, the team (`onOpenTeam`), the project (`onOpenProject`) or Settings → System analysis. A thread's or a team's analysis has **New analysis** (the setup dialog, warning that it replaces this one); a builder or project chat has **Start over** (a confirm, then `DELETE` and a fresh `POST` of its chat, opened in its place). A setup change in one is remembered as the next one's default (`rememberSystemChatSetup`).
- Every entry point opens its chat here (`openSystemChat`, which unarchives an archived one first): Analyze on a thread opens its analysis when it has one, else the setup dialog, whose start opens the new one; the team's Change with chat and Analyze & improve, the project's Change with chat and Settings → System analysis go through the app's `onOpenThread` (a builder chat's first draft rides `openRunDraft`). The Analyze button still marks the thread's analysis (tint; a dot while working or waiting on you), read by `useThreadAnalysis` over `useFollowedChat`.
- A page whose file a system chat edits follows that chat without drawing it (`useFollowedChat`: its lookup `GET`, then its `run_status` announces; again on a delete of it, a reconnect or `refresh`) and registers a before-send guard under its subject (`team:<slug>`, `project:<id>` — `systemChatSubjectOf`) in the app's one registry (`BeforeSendGuardsContext`). The Chats screen awaits that guard before every turn it starts in the chat — a typed or queued message (`startTurn`), an agent's or a surface's button press, a recommendations Apply, a Retry (`runPageGuard`) — so the agent reads what the page holds and a queued message never leaves before the page has read back the agent's last edit.
- A team's analysis setup dialog asks the daemon whether the picked agent and model share the members' vendor (`checkTeamAnalysisJudge`) and, when most members do, says a judge marks its own vendor high and offers the other agents. Its `Period` picker's count line is read from `GET /v1/teams/:slug/analysis-runs` on open and on each change, a stale answer never landing. A builder chat posts the same recommendations card (its agent reads the team's latest runs), applied by the chat screen's own `applyRecommendations`.
**Run waterfall** (`chats/run-waterfall*.ts(x)`, the "Where the run went" full-screen view, opened from the thread header's ⋯ menu):
- Every span, its `seq` (what "Open in chat" jumps to) and the critical path come from the daemon's waterfall route; the renderer never folds them from loaded `items`.
- `blocksCaller` (`run-waterfall-geometry.ts`) is a twin of the daemon's critical-path rule in `v1/agents/utils/thread-timeline.ts`: any call not `async` holds its caller. Change one, change the other.
- The full view reads ONE state (zoom window, selected mark, focused agent); the tables count a turn's time where it overlaps the window and its money where it ended (`run-waterfall-breakdown.ts`).
- It opens as a SEQUENCE DIAGRAM (`run-waterfall-sequence.tsx` over `sequenceLayout` in `run-waterfall-sequence-layout.ts`; Calls / Lanes, `geniro.waterfall.lanes`): a column per agent, time running down, a numbered horizontal arrow per call (numbered by when it was made) from the caller's turn at that moment and a dashed one back under the same number for a call its caller waited on (`blocksCaller`). Arrows are one neutral colour (lit or failed aside); agent colours stay on the columns and bars. Turns of one agent running at once are stacked `NEST` pixels apart, and calls one agent made within `SEQUENCE_PARALLEL_MS` with no other arrow between are framed as "N at once" (`SequenceLayout.groups`). Every arrow has a row of its own at least `SEQUENCE_ROW_MIN` below the last, and an event-free stretch over `SEQUENCE_BREAK_MS` is drawn as a short break, so nothing overlaps. Pointing at or selecting a call lights the turns that answered it (`RunWaterfallTurn.callId`); a turn lights the calls it made.
- In Lanes, every call is drawn as a rounded line between its lanes (`CallLinks`, under the bars, measured off the DOM after layout): out of the caller's turn at the moment of the call, bending into the start of the turn that answered it — the daemon's `RunWaterfallTurn.callId`, overlap only for a run recorded before turns named their call — and, for a call its caller waited on (`blocksCaller`), dotted back into the caller at the moment it returned. Lines stay quiet until the pointer is over a turn or call, which lights that mark's own links (a selected call keeps its lit); the Links switch (`geniro.waterfall.callLinks`) keeps only the selected call's.
- The lanes are drawn `scale` card widths wide (`GANTT_SCALES`, 2× to start) and scroll sideways under the pinned name column; ⌘/Ctrl + wheel steps the scale around the pointer.