Part 2 of 12 · 2 min read
Collapsing detail is safe only when critical events are exempt
A dashboard that shows everything is as useless as one that shows nothing. The point is which few things it always shows.
Think of a car dashboard: dozens of sensors feed it, but it shows a handful of gauges plus warning lights that never hide, no matter how calm the drive has been.
In plain words: an agent's event stream can run to dozens of items, so the screen has to collapse most of them into a summary. But a few kinds of event, like an unresolved approval or an unrecovered error, must never be among the things collapsed away.
A worked example. A simulated run of 82 events shown raw is 81.7 items — basically no compression at all. Grouping repeated tool calls and folding results into their calls brings that to 25.7. The summary view (status line, attention items, and changes only) brings it to 1.4 items. Across every one of these simulated runs, every unresolved approval and every unrecovered error stayed visible in the default view, regardless of which view mode was active. That invariant is tested, not just hoped for.
The key lines. From code/mini-ui/progress.py:
# from code/mini-ui/progress.py
def needs_attention(events):
"""Unresolved approvals and irreversible changes, plus errors with no later successful step (not recovered)."""
resolved = {e["ref"] for e in events if e["kind"] == "approval_resolved"}
out = []
for i, e in enumerate(events):
if e["kind"] in ("approval_needed", "irreversible_change") and e["id"] not in resolved:
out.append(e)
elif e["kind"] == "error" and not any(x["kind"] == "tool_result" for x in events[i + 1:]):
out.append(e)
return out
Read it as: this function runs independently of whichever view mode is chosen, and its output is added back into every view. The collapsing logic and the never-hide logic are two separate code paths. That's exactly why one can't accidentally swallow the other.
View model
A view model is the data a screen renders, derived from the raw events and state but kept separate from the drawing code. The same underlying data can produce a raw log, a grouped timeline, or a one-line summary.
Example: build_view above produces status, attention, items and changes as plain data. A UI layer then decides how to draw each of those, but the collapsing and the never-hide rule both happen before any drawing code runs.