[Feature] Local browser dashboard for daemon-backed sessions and subagent trees #1421
mahmutkaya
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Area
Coding agent and CLI
Problem
Prime Agent's only interface is the TUI, but the runtime underneath it stopped being single-session a while ago. A supervisor routes many resident workers, each owning a root session tree with RLM descendants, schedules, heartbeats, and goals that keep running after the terminal detaches (
docs/daemon.md,docs/long-running-agents.md). There is no way to survey that state.Concretely, today:
prime-agent agentsis the only cross-session view, and it is TTY-only. It occupies a terminal, shows one pane, and cannot sit on a second screen while I work in the first.attachedClients. Watching three means three terminals./exportto HTML, which is a dead snapshot. Re-exporting to see progress is not a workflow.sessions/— they live undersession-artifacts/<root>/sub-<childId>/<uuid>.jsonl.The docs already point at a browser client as the answer and then stop short of one.
docs/sdk.mdlists "Build a custom UI (web, desktop, mobile)" as its first use case,docs/rpc.mdsays RPC exists for "custom UIs", anddocs/agent-connection.mdstates the invariant such a client must respect: "the UI can be rich and client-specific, but it cannot own agent execution." Nothing in the repo takes that offer up, and I could not find an existing Discussion, Issue, PR, or branch on the topic.Proposed direction
A local browser dashboard for observing and managing daemon-backed sessions. Read-only first, interactive later.
The framing I would like to check with you before anything else: this is
core/export-html/made live, not a new design language.template.cssandtemplate.jsare already a complete session renderer with a tree sidebar, search, the default/no-tools/user-only/labeled-only/all filters, diff rendering, ANSI conversion, and an image modal.generateThemeVars()already projects every theme token into--<token>CSS vars, andprime.jsonalready fixes the palette. A live UI should reuse that renderer and those tokens verbatim so the browser and the TUI cannot visually drift.Shape:
Three invariants keep it additive:
AGENTS.mdare triggered.packages/agent,ai,coding-agent, ortui. Thepackages/*workspace glob, the roottsconfig.jsoninclude, and thebiome.jsonincludes pick a new package up on their own. The one optional exception is appending a segment to the rootbuildscript.Phasing, each a separate reviewable unit:
list, classified with the already-exportedbuildAgentsViewRows/classifyAgentsViewSession/filterUnifiedSessionsso it matchesprime-agent agentsexactly rather than reimplementing the rules. Transcript fromget_messages+get_session_tree. Subagent tree. Live updates relayed fromsession_event/session_status. Theme switching from the existing theme JSON.prompt/steer/follow_up/abort, queue view, model and thinking controls,compact,refine, and the extension UI request/response round trip.The security model is the part I would most like reviewed, because the bridge is the entire boundary.
daemon-supervisor.tsmarks every accepted socketauthenticated: truebefore reading anything, so the filesystem is the only gate on the daemon socket today. That is fine for a Unix socket at 0600 in a 0700 directory and wrong the moment a browser page can reach it. My assumption is: loopback bind only, a bearer token minted per bridge start and printed once, an Origin/Host allowlist,READ_ONLY_DAEMON_COMMANDSas the default allowlist with writes behind an explicit opt-in flag, and browser-facing DTOs versioned at the bridge edge rather than passingAgentMessage/AgentEventthrough raw, sincedaemon-protocol.tsandagent-connection/types.tsare explicit that those are local TypeScript contracts and not a stable network schema.Alternatives considered
/exportHTML. Already the visual baseline I want to build on, but a static snapshot.sessions/*.jsonldirectly. Works with no daemon and is the most stable schema in the repo, but gives no live events, cannot mutate, and silently misses every subagent unless the reader also walkssession-artifacts/. Useful as a degraded fallback, not as the design.DaemonClient,defaultDaemonSocketPath,DaemonAgentConnection, theAgentConnectioninterface, and the agents-view helpers are all already exported. This is my open question below.Additional context
I am not a vouched contributor, so I am not asking to open a pull request. I am asking whether this direction is wanted at all, and in which of two forms:
packages/web-bridgeplus aweb/bundle, or@earendil-works/pi-coding-agent.If the answer is (2), or if you would rather see it before deciding, I will build it out-of-tree and come back to this Discussion with a working read-only dashboard and screenshots, so there is something concrete to judge instead of a proposal.
Two implementation notes from reading the source, in case they are useful independent of this request:
docs/daemon.mdanddocs/agent-connection.mdboth state protocol v4. The source isDAEMON_PROTOCOL_VERSION = 7withDAEMON_SCHEMA_REVISION = 16(packages/coding-agent/src/modes/daemon/daemon-protocol.ts:53-63). Happy to send that doc correction on its own if you want it.list+get_stateand attach only to the session actually being viewed, sinceattachbumpsattachedClientsand feeds worker residency and idle eviction. Observing should not change scheduling behavior.One constraint I would want confirmed either way: if a browser client is unwanted in this repo for reasons beyond scope, say so plainly and I will keep it out-of-tree. It is more useful to know that now than after the code exists.
All reactions