Skip to content

feat: global agent stats in the Office and the observer's snapshot - #46

Merged
Mariusfaitducode merged 10 commits into
marius/mainfrom
feature/office-stats
Nov 17, 2026
Merged

Mariusfaitducode merged 10 commits into
marius/mainfrom
feature/office-stats

Conversation

@Mariusfaitducode

Copy link
Copy Markdown
Owner

Stacked on #42, #43, #44 and #45: this branch starts from build/next (2134aee), so the diff includes them until they land on marius/main. Merge it after them. Review from commit de0d04e.

What changes for Marius

A stats strip on top of the Office, with every open agent whatever the filters hide. Each number filters the Office to the agents it counts, a second click shows all again.

Number Definition
Open every live agent of the Office (same list as the desks)
Working work state working
Waiting for you work state waiting
To resume todos + resume (tooltip splits them)
To check check (silent turn for over 1 h)
To close done
Subagents live subagents + workflow agents, click = agents running some
Per host open agents per host (tooltip: working, waiting)
Per model open agents per model of their latest answer (Opus 5.5, Sonnet 4.5…), plus Unknown
Tokens input + cached + output of the open sessions since they started, and the cost at API list rates. Click opens Usage

The groups are a partition of the #45 states, computed from the same deriveWorkState output the desks use, so the numbers always add up to Open. "To check" stays its own number and is not counted in "To close": it means "look first", not "close".

The header counts ("N waiting on you · N working · N subagents") are removed, the strip replaces them.

Models and tokens come from a new host procedure terminalAgents.liveSessionStats: one read per host of the per-session stats the sidebar already shows (sessionStats, parsed from the Claude / Codex transcripts on the agent's own host, so remote hosts work). Older hosts answer "missing procedure" and show as unavailable. Period totals (today, week) stay in Usage, not duplicated here.

superset observer snapshot now uses the #45 states:

  • the work-state derivation moved to @superset/shared/work-state (the app re-exports it, no behaviour change), and the CLI runs it with the same sources: lifecycle, every report, to-dos, pins (conversationStates)
  • each conversation gets work (state, cause, pinned) and model, the digest gets fleet with the strip's numbers
  • --all-hosts reads every online host and adds them up
  • limit: the CLI can't know if a reply was read in the app (read marks are only in the renderer). A stopped agent is counted as read, and work.ifUnread / fleet.readUnknown say how many could be "waiting" in the app. Syncing read marks to the host would remove this, left for later
  • the superset:observer skill uses --all-hosts and explains these fields

Decisions

  • Strip only in the Office. The sidebar host switcher already counts per host, and Settings → Usage already has tokens by period, so I didn't copy them there
  • Host and model filters are not persisted (a click from the strip is for the moment), state filters stay persisted as before
  • One request per host instead of one per conversation for models, to keep the request count low

Tests

  • packages/shared: agent-fleet-stats.test.ts (groups, hosts, models, labels, usage)
  • packages/cli: digest derives the Office states (read, unread, pinned, silent, permission), fleet numbers, unavailable models, multiple hosts
  • packages/host-service: listLiveSessionStats
  • desktop: office filters (host, model, children) and the filter store
  • Not tested locally: desktop typecheck (CI), the UI itself

To test

  • Office: the strip numbers match the state chips with no filter, clicking each one filters the desks
  • A remote host (Tour) shows its count and models
  • superset observer snapshot --all-hosts

🤖 Generated with Claude Code

Mariusfaitducode and others added 10 commits November 12, 2026 11:50
…a PR branch

The Mine details pass now also reads my last review (state, date, whether
it is on the current head), whether the author pushed, replied or commented
after it, the base branch, and whether the branch is behind its base. Same
GraphQL batch, no extra call.

pullRequests.updateBranch merges the base into a PR branch on GitHub, like
its "Update branch" button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion

Up to five PRs to handle first, in the order of the morning PR report:
merge what is approved and green (or update its branch when it is behind),
review, re-review when the author moved since my review, fix my blocked
PRs, then ask for a review on my PRs nobody was asked to review. Each card
says why, shows the PR it is stacked on, and has its one action button:
Merge (squash, with a confirmation), Update branch, Review, Fix with agent,
Ask for a review. The clock moves a PR to Later.

The list gains the same reasons: a PR whose author answered or pushed since
my review moves to Review, and my PR with no reviewer moves to a new
"Ask for a review" group instead of waiting on others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A one-click target on each workspace (sidebar rows, Ctrl+Tab cards, Office
name plates, Hosts page, Workspaces list and board) puts it in focus; ⌘⇧F,
the context menus, bulk selection, the command palette and F in Ctrl+Tab do
the same. Focused workspaces show a bold name and an indigo target. One
shared "Focus" filter narrows the sidebar, Ctrl+Tab, ⌘K, Office, Hosts,
Workspaces and Needs you.

The Office's "Active" filter (agents not resting) is renamed "Working" so
"active" no longer means two things.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gent

A booth in the Office corner shows the observer's state, its last run and
headline; its panel lists the latest findings by mission (your work,
efficiency, Superset) with a link or the conversation to open, and starts
a run in a fresh session ("Run now") with the agent the user picks.

The run itself is the superset:observer skill: it reads one digest of every
agent (`superset observer snapshot`), the to-dos, Desk reports, Superset
ideas, PRs and, through the messenger agent when there is one, messages;
writes a dated Markdown synthesis and publishes the short version with
`superset observer publish`. It only reads and hands over through the Desk.

Runs are kept host-side in ~/.superset/state/office-observer.json, like the
reports, and pushed to the app through the host-store event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts crossed with PRs and Notion

Each open conversation now has one work state, the same in the Office, the
sidebar and the to-dos panel: waiting for your answer, to check, working,
resume with its to-dos, resume later, or done and closable. It is derived
from the conversation's own live signals (lifecycle, reports of its latest
turn, to-dos, read or not), never from workspace labels. The user pins a
state in one click from the to-dos panel or the Office; the host keeps the
pin (`conversationStates`, `superset state`) until the agent's next turn.

The Office shows only workspaces with open agents, filters by state (with
counts), project and Notion project status, groups rooms by folder or by
project, and opens a project panel with its PRs, Notion page and specs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tegration

# Conflicts:
#	apps/desktop/src/renderer/hooks/host-service/useHostStoreRefresh/useHostStoreRefresh.ts
#	apps/desktop/src/renderer/routes/_authenticated/_dashboard/office/components/OfficeView/components/OfficeFloor/OfficeFloor.tsx
#	packages/host-service/src/events/types.ts
A strip on top of the Office counts every open agent, whatever the filters
hide: working, waiting for you, to resume (with to-dos or later), to check,
to close, subagents and workflow agents, per host and per model, and the
tokens and estimated cost of the open sessions. Each number filters the
Office to the agents it counts.

The work-state derivation moves to @superset/shared so the CLI runs the same
one: `superset observer snapshot` now gives each conversation its Office
work state (pins, reports, to-dos, lifecycle) and the strip's numbers, and
`--all-hosts` adds them up across every online host. The CLI cannot see
whether a reply was read in the app; it counts stopped agents as read and
says what they would be if unread.

Models and tokens come from a new host procedure,
`terminalAgents.liveSessionStats`, one read per host of every live agent's
transcript stats; older hosts show them as unavailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mariusfaitducode
Mariusfaitducode merged commit 6bf4d81 into marius/main Nov 17, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant