DevLog
← Back to Blog

Inside HQ Console Live: The 5-Tab Monitoring Dashboard for Personal Agent Systems

By • 10 min read
This article is also available in Chinese: 🌐 阅读中文版 →

When an agent runtime stops being a single chat thread—when it starts spawning isolated git worktrees, holding SHA-256 outbound approvals, enforcing MEMORY.md size caps, and running scheduled background jobs—you lose situational awareness surprisingly fast.

Without a monitoring dashboard, answering basic operational questions turns into cat archaeology across half a dozen JSON files:

  • Is any outbound email, PR merge, or shell command blocked waiting for my sign-off?
  • Which subagents are running right now, and which git worktree has uncommitted edits?
  • How close is my long-lived coordinator thread to blowing its prompt cache or MEMORY.md cap?
  • Why did yesterday’s spend spike across models, and did any background schedule silently go stale?

Inside github.com/zjshen14/agy-hq, HQ Console Live (./bin/hq webui) is the single control screen built to answer those questions—exposing every moving subsystem in one view. (Part 1 covers how Antigravity delivers that same page on both desktop and phone.)

First, let’s tour what the dashboard monitors across all five tabs using real sandboxed --demo captures. Then we’ll go under the hood to see how it updates cleanly every 5 seconds—and four telemetry bugs uncovered by auditing 639 real sessions (2.93B gross tokens).


The Tour: Five Tabs, Five Questions

Instead of one endless scrolling log, the console splits monitoring into five tabs beneath a shared four-card KPI header (pending items, active work, today’s uncached tokens and cache-hit rate, and estimated cost vs. savings). Each tab answers one question:

TabThe question it answers
Needs MeWhat is waiting on me?
WorkWhat is running right now, and where?
MemoryWhat does the agent remember, and is the index bloating?
TokensWhat is this costing, and where is the waste?
OpsDid the background automation stay healthy?

1. Needs Me — Human Approvals & Escalations

The default tab answers the highest-priority question first: What requires my sign-off or judgment before work can proceed?

HQ Console Needs Me tab captured from a synthetic demo environment showing KPI header cards, an ACME Q3 Digest SHA-256 approval card with Approve/Reject controls, an urgent canary promotion decision card, an active Q4 Edge Proxy Cutover goal tracker card, and a queued Living Space idea card.

Tab 1 (Needs Me): Human attention queue—isolating cryptographic approvals, escalations, goals, and low-urgency suggestions.

  • Pending Approvals: Every high-blast-radius command staged via hq propose displays its plain summary, exact shell command, and cryptographic hash (sha256:...). The digest guarantees that what you approve is byte-for-byte what runs—nothing can alter the command between your click and execution.
  • Urgent Decisions: Genuine blockers escalated by background workers render recommended vs. alternate actions (for example, investigating a 50% canary vs. holding at 10%).
  • Active Goals & Overdue Replies: Tracks multi-day goals (q4-edge-cutover) and overdue replies (people or PRs blocking progress).
  • Ideas Backlog: Collects low-urgency background ideas (Promote, Snooze, Dismiss) so helpful thoughts never hijack your coding chat.

2. Work — Live Threads, Git Worktrees & Two Kinds of Spaces

Once approvals are clear, Work shows what is running concurrently across your repositories:

HQ Console Work tab showing the Live Task Board with active coordinator RFC tasks and tracked top-level subagents, Active Workspaces git worktrees with dirty/clean status badges and write locks, an Active Console Spaces pulse summary with 2/3 milestones, and a Sandboxed Living Space launcher.

Tab 2 (Work): Active threads, exclusive git worktree locks, scheduled Console Spaces (2/3 milestones), and Living Space launchers.

  • Live Task Board: Tracks multi-turn task threads and top-level spawned workers (filtering out noisy nested helper calls) alongside model, conversation link, uncached tokens, cache-hit %, last turn summary, and inline Complete / Archive buttons.
  • Active Workspaces (core/git-worktree): Displays every checked-out git worktree (clean vs. dirty), write lock (🔒), and open PR state—preventing parallel agents from colliding in the same directory.
  • Two kinds of “Spaces”: Console Spaces are scheduled domain status cards that surface during configured windows (for example, Active Engineering Pulse on weekdays 10:00–18:00 tracking dirty branches and 2/3 milestones targets). Living Spaces are full compiled interactive micro-apps launched via Open Sandboxed Space ↗ (covered in Part 3).

3. Memory — Index Caps & Keeping Private Data Out of HTML

Long-lived agent memory fails quietly when always-loaded prompt indexes bloat or when confidential personal records reach HTML views:

HQ Console Memory tab captured from the demo environment showing the MEMORY.md budget tile (6/40 lines, 321/2200 bytes), single dual-cap utilization progress bar at 15% HEALTHY, Compact Facts action button, 1 private profile field (CLI-only) count, Verified Facts cards with Prune controls, Topic Wiki and Contact Dossiers sections, and the bottom dashed Private Household Profile Boundary footer with Copy CLI button.

Tab 3 (Memory): Tracking MEMORY.md against its 40-line / 2,200-byte cap, pruning expiring facts, and keeping private/ values out of browser JSON/HTML.

  • Root Index Budget (40 lines / 2,200 bytes): One combined utilization bar tracks always-loaded MEMORY.md (15% · HEALTHY at 6 / 40 lines and 321 / 2200 B), warning before bloated prose squeezes working context.
  • Private data stays out of the browser: The tab confirms how many private profile fields sit on disk (“1 private profile fields (CLI-only)”) without ever serializing their values into Console JSON or HTML. When you need one, the bottom 📋 Copy CLI button copies hq memory profile get cleanly.
  • Facts, Topic Wiki & Dossiers: Lists [PINNED] rules alongside expiring facts (with inline Prune buttons and top-level 🧹 Compact Facts), followed by searchable accordions for Topic Wiki & Active Playbooks and Contact & Channel Dossiers.

4. Tokens — Context Pressure, Cost Attribution & Cold Wakeups

Slowdowns and surprise token bills usually hide inside creeping context windows, hidden subagent fan-out, and evicted prefix caches:

HQ Console Tokens tab displaying daily uncached burn (94k / 50.00M), 88.8% prefix cache hit ratio, Front Desk 512k context gauge sitting at 148k with 120k warn and 180k crit cold-wakeup tick marks, model/family stacked bar (Claude, Gemini Pro, Gemini Flash), and disjoint Front Desk coordinator vs subagent trees.

Lower half of the Tokens tab showing pure-SVG 7-day daily uncached bar chart, 24-hour hourly bar chart, and an active A1 FrontDeskContextBloat warning card explaining the 148k context length and 5-minute cold-wakeup cache risk.

Tab 4 (Tokens): ~512k context gauge (120k / 180k cold-wakeup marks), split coordinator/subagent spend, pure-SVG 7d/24h charts, and rule-based hygiene warnings.

Why warn at 120k when the compaction limit is ~512k? Upstream model providers typically drop warm prompt caches after roughly 5 minutes of idle time. So if a 150k-token thread sits untouched while you grab coffee, your next one-line question triggers a full 150k uncached cold prefill—a cold wakeup. Those tick marks highlight the exact zone where coffee breaks get expensive.

  • Per-Model & Tree Attribution: Breaks down turns, uncached input/output, cache read (% hit), estimated API-equivalent cost, and prefix-cache savings by model—then splits spend between the coordinator’s own turns (Self) and spawned Subagents so nothing is counted twice.
  • 7d / 24h Charts & Built-In Warnings: Renders zero-library hoverable SVG bar charts above five rule-based alerts (A1–A5), such as A1 · FrontDeskContextBloat suggesting /compact or a fresh coordinator shift (hq release-desk).

5. Ops — Gatekeeper Quotas, Daemons & Turn Logs

Finally, Ops shows whether background automation stayed inside its safety rails:

HQ Console Ops tab displaying Background Auto Spawns Today (1/15) with BUDGET OK badge and HEARTBEAT_OK status, Scheduled Automations showing gmail-inbox-watch, morning-brief, and sleep-consolidate daemons alongside an overdue stale ad-hoc-cron card with Remove button, and Today's Turn Journal.

Tab 5 (Ops): Daily auto-spawn quota meter (1 / 15), OS daemons, overdue stale chat schedules, and newest-first Turn Journal.

  • Daily Auto-Spawn Budget: Tracks background trigger runs (1 / 15 with HEARTBEAT_OK) and flips visibly to CIRCUIT OPEN if runaway automation trips daily limits.
  • Core OS Daemons: Lists gmail-inbox-watch, morning-brief, and sleep-consolidate with Pause / Run Now controls and inline connector auth expiry warnings when logins need refresh.
  • Chat Crons & Turn Journal: Flags recurring in-conversation schedules left orphaned after restarts with an amber stale badge and Remove button (ad-hoc-cron), followed below by Today’s Turn Journal (newest-first) and hq doctor System Health checks.

Under the Hood: How It’s Built and Calibrated

All five tabs render from the single ~110 KB pure-Go template described in Part 1, serving desktop live sidecars and offline phone snapshots alike. Below is what matters specifically for keeping an all-day monitoring dashboard responsive and honest.

Two-column architecture diagram: Left shows the 5-plane Go state aggregator and <details>-preserving 5-second refresh loop with a pointer back to Part 1 for dual-surface transport; Right shows the 639-session audit (2.93B gross tokens) fixing the 54.0% multi-model overwrite bug, 28.9% role-tier pricing drift, subagent tree double-counting, and 512k / 120k / 180k context thresholds.

Architecture summary: stateful 5-second DOM updates paired with telemetry math calibrated against 639 real sessions.

1. Refreshing Every 5 Seconds Without Wrecking What You’re Reading

  • Why 5-second /api/state polling beats WebSockets here: Polling full JSON every 5 seconds trades sub-second push updates for rock-solid simplicity—there is zero socket state to lose or reconnect when a laptop wakes from sleep, and one endpoint backs SSR first paint, live sidecars, and automated tests.
  • Preserving expanded trees & search typing: Before updating dynamic lists, the page records which <details> accordions you have open and restores them right after redrawing. Search inputs live outside the replaced list containers, so typing a filter never loses focus—and write actions (Approve, Pause, Prune) add per-page CSRF validation.

2. Four Telemetry Bugs Caught Across 639 Sessions (2.93B Gross Tokens)

Our earliest Tokens numbers looked plausible on screen—until we wrote an audit script checking 639 real sessions (2.93B gross tokens, 90.845% pooled prefix-cache hit rate) directly against step logs. Four bugs jumped straight out:

  1. The 54.0% Multi-Model Session Overwrite Bug:
    Symptom: Mixed-model conversations appeared as if a single model ran every turn.
    Cause: Raw transcript steps omit model names, so our initial collector read per-turn journal files in alphabetical directory order (-10.json before -2.json) and saved whichever model won last onto the whole conversation. Across just 13 mixed sessions, 153.4M of 284.32M uncached tokens (54.0%) landed under the wrong model.
    Fix: Join each transcript step directly against its turn’s journal entry (stepStartIdx / stepCount) so multi-model sessions attribute every step accurately.

  2. 28.9% Role-Tier Pricing Drift:
    Symptom: Quota burn looked artificially inflated across mixed workflows.
    Cause: Early routing checked the task’s tier hint (quick, standard, deep) before checking the actual executed model (NormalizeTier), billing cheap Flash runs spawned under [Deep] tasks at 5.0x deep weight—distorting gross weighted burn by 28.9% across 34 mismatched sessions.
    Fix: Compute cost and quota weight strictly from the model that actually executed.

  3. Subagent Tree Double-Counting:
    Symptom: A single multi-worker audit occupied multiple overlapping rows in “Top Expensive Tasks”.
    Cause: Ranked tables listed standalone child workers alongside parent coordinator threads whose totals already rolled up child spend.
    Fix: Split parent coordinator turns (Self) cleanly from nested Subagents so trees remain strictly non-overlapping.

  4. Stale 256k Compaction Ceilings vs. Empirical ~512k:
    Symptom: Context gauges hit 100% prematurely while cold-cache stalls arrived unannounced much earlier.
    Cause: Real session traces compacted near ~512k rather than 256k, whereas expensive cold wakeups already kicked in around 120k–180k.
    Fix: Re-scale the bar to 512k and overlay the 120k warn and 180k crit cold-wakeup markers (explained in Tokens above).

The takeaway across all four bugs: Attribute cost to what actually ran, never to what you expected to run.


Quickstart

Launch the isolated demo dashboard locally and start on Needs Me before clicking through Work, Memory, Tokens, and Ops:

./bin/hq init --demo && ./bin/hq webui

(To inspect an existing vault with background tickers and mutating HTTP routes disabled, pass ./bin/hq webui --read-only, which implies --no-heartbeat.)

Share this post

Scan with WeChat

Scan this QR code with WeChat to read or share on mobile.

Link copied to clipboard!