Repository navigation
Description
Summary
mecatui has no visibility into subagent / Task activity. This is the largest remaining gap from the mecatui UX review (it mirrors the loudest emergent 2026 community ask — the "agent hierarchy dashboard" pattern). mecatl spawns subagents two ways and both are a black box in the TUI today:
- The
Tasktool (internal/agent/subagent.go) runs a fresh read-only agent in an isolated context and, by design, drains the child's entire event stream insideExecute(drainChild) — discarding everyturn.start/tool.call/tool.result/message.deltaand folding back only the final summary string. The user sees a singleTasktool card spin on…then resolve. No goal, no progress, no per-child tokens, no elapsed. - Agent teams (
internal/team/,internal/adapter/server/team.go, theRunTeamstream inharness.proto) drive N long-lived member sessions. Here the data already exists:RunTeamstreams aTeamEvent{member, Event}per member. But the TUI has no concept of a member, so N interleaved streams would collapse into one unreadable scrollback.
Design principle: one model, 1→N
The TUI renders purely from streamed events. So the design reduces to: give every event a parent/member identity, route by identity, render an Agents panel keyed by identity. A single Task subagent is the N=1 case of a team roster. Reuse three existing idioms: the MCP overlay pattern (opt-in, esc-dismissable, ctrl+* to open), the ctrl+t expand toggle, and the Tier-A context meter (▒▓█░ per-band glyph bar) for per-agent context %. The single-agent conversation view stays untouched; subagent activity never pollutes the main scrollback unless the user opts in.
1. Single Task subagent — inline card (MVP)
Keep the existing blockTool card as the anchor; while unresolved, show a live sub-status line fed by new lightweight events.
Collapsed (default):
… Task "audit auth middleware for missing checks"
⟳ subagent · Grep · 8.2s · ↑3.1K ↓410 · 3 tools · ctrl+t details
Expanded (ctrl+t) — a capped, opt-in trace of the child's tool calls (the only place the child's interior is shown; tool names/status only, never child message text):
… Task "audit auth middleware for missing checks"
subagent subagent-call_7f3 · running · 8.2s · ↑3.1K ↓410
✓ Grep "func.*Handler" internal/http 12 matches
✓ Read internal/http/mw.go 1–80
⟳ Grep "ValidateToken"
… child trace capped at 12 calls · ctrl+t collapse
On completion the card resolves as today (summary string → resultBody), with a terminal stat line:
✓ Task "audit auth middleware for missing checks"
subagent done · 14.6s · ↑5.2K ↓820 · 6 tools · 0 writes
Found 2 handlers that call the DB before ValidateToken… (summary)
This MVP needs no new panel/key — just intermediate events and one status line on the existing card.
2. Multi-agent — the Agents panel (ctrl+a)
A new overlay styled like the MCP inventory panel. Each row is one identity (lead at the root, members beneath): state · current activity · tokens · context meter.
┌─ agents · team-3kf9 · 4 members · round 6 ──────────────────────┐
│ │
│ ◆ lead working delegating │
│ ↑12K ↓2.1K · ctx ▓▓▓▓▒░░░ 58% · 92K/200K │
│ │
│ ├─ ◆ scout working Grep "ValidateToken" 6.1s │
│ │ ↑8.4K ↓900 · ctx ▒▒▒░░░░░ 31% · 62K/200K │
│ │ │
│ ├─ ◆ patcher working Edit internal/http/mw.go 2.3s │
│ │ ↑31K ↓7.2K · ctx █████▓▓░ 88% ⚠ · 176K/200K │
│ │ │
│ └─ ○ scribe idle awaiting message │
│ ↑2.1K ↓310 · ctx ▒░░░░░░░ 9% · 18K/200K │
│ │
│ tasks 5 done · 1 in-progress · 2 pending(blocked) │
│ ↑/↓ select · enter focus member · t tasks · esc close │
└──────────────────────────────────────────────────────────────────┘
◆working/spawning,○idle, dim✓stopped — glyph-encoded state (colourblind-safe, survives ANSI stripping), mirroring the context-meter glyph-not-colour rule.patcherat 88% ⚠ reuses the context meter's existing danger mark — directly answering "which agents are near their context limit."- Tree connectors express parent→member; the lead sits at the root (it is a
team.Memberwith theLeadflag). enterfocuses a member → its tagged events render in the main viewport (a per-member filter over the bufferedTeamEventstream), so one agent's transcript is readable without the N-way interleave.escreturns.tflips to the shared task list (ListTeamalready returnsteam.Task: id · state · assignee · deps).- A footer summary advertises activity without forcing the panel open:
⟳ team-3kf9 · 3/4 working · ctrl+a agents.
Auto-open policy: do not auto-open (it steals the keyboard, like the idle-only MCP overlay). Surface the footer summary when a team is live; ctrl+a opens the panel. The single-Task case never opens a panel — its inline card is enough.
3. Data / events the harness must emit
| Surface | Today | Needed |
|---|---|---|
| Team members | RunTeam already streams TeamEvent{member, Event}; TeamMember{name, agent_type, state} and TeamTask exist. |
TUI client consumes the RunTeam stream and routes by member into per-identity render state. The session Event already carries usage/turn_end (tokens). Gap: per-member context-window size isn't on TeamMember — add context_used/context_window (or surface the member session's cumulative Usage + model window) so the per-agent meter has a denominator. The member's current tool is derivable client-side from the latest tool.call per member (likely no new field). |
| Task subagent | subagent.go's drainChild emits nothing intermediate — the parent sees one tool.result. |
Add minimal child-progress events the parent forwards instead of discarding, carrying parent_call_id + child session_id: subagent.start{goal, child_id}, subagent.tool{child_id, tool_name, ok}, subagent.end{child_id, usage, tool_count, stop}. handleChildEvent is the single chokepoint — it can forward a redacted projection (tool names + usage, not child message text, preserving context-isolation) up to the parent's EventSink. |
Both cases converge on the same client-side shape: (identity, kind, activity, usage, ctx). Team tags by member; Task tags by child session_id. For N=1 (Task) the "roster" is the inline card; for N>1 (team) it's the panel.
4. Open questions & tradeoffs
- Screen real estate — the panel is an overlay (no permanent cost), but the footer summary competes with the context meter on narrow widths; needs a
fitFooter-style tier. - Nesting depth — teams are flat (lead + members);
Tasksubagents can't recurse (child catalog excludesTask). A 2-level tree is sufficient today; don't build arbitrary depth. - Performance —
MaxMembers = 32. Render from a per-member last-event projection (a snapshot), not by replaying buffered events each frame; cap the per-member focus buffer (reuse themaxToolResultLinesidiom). - Child trace verbosity — showing every child
tool.callrisks re-bloating whatTaskexists to keep out of context; mitigate by keeping it opt-in (ctrl+t) + hard-capped + names/status only. - Event volume —
subagent.toolper child call adds wire traffic; could gate behind a server flag and fall back to start/end-only.
5. Phased plan
- MVP — inline Task visibility. Forward
subagent.start/tool/endfromhandleChildEvent; render the live sub-status line + terminal stat on the existingTaskcard. No new panel/key. Biggest win for the smallest change. - Team consumption + footer summary. Wire
clientto theRunTeamstream, route bymember, show the⟳ team · k/N workingfooter segment. - Agents panel (
ctrl+a). The roster overlay, modelled onmcp.go, with per-agent state/activity/tokens/context meter. - Member focus + task sub-view.
enterto filter to one member;tfor the shared task list. Addcontext_used/windowtoTeamMemberif needed.
Key files
- Inline card + events:
internal/agent/subagent.go(handleChildEvent,drainChild),cmd/mecatui/ui/render.go(renderTool). - Panel reuse:
cmd/mecatui/ui/mcp.go(overlay),cmd/mecatui/ui/footer.go(renderContextMeter/ctxLabel),cmd/mecatui/ui/keys.go. - Team data:
internal/adapter/server/team.go(RunTeam/ListTeam),TeamEvent/TeamMember/TeamTaskincontracts/proto/mecatl/v1/harness.proto.
Drafted from the mecatui UX gap analysis. The interface above is a proposal to spark implementation, not a final spec — the phased plan front-loads the highest-value, lowest-cost step (inline Task visibility).
Activity
feat(mecatui): files-changed summary + structured hook notices
feat(mecatui): inline Task subagent visibility
feat(agent): Team tool — form a team as an agent operation
feat(mecatui): inline agent-team visibility on the Team card
JAORMX commentedon May 30, 2026
Update — shipped, with a design pivot
The MVP (inline Task subagent visibility) and full agent-team visibility are now on
main. During implementation the team approach pivoted from this issue's original operator-driven plan (TUI consumesRunTeam/ListTeam+ actrl+adashboard) to an agent-driven model that the maintainer preferred:Teamtool (sibling of Task/Fork) that drives the in-processSupervisor. The TUI is observe-only — it renders the team from the same Converse event stream it already reads, so there's no client-sideRunTeam/ListTeamconsumption.team.start/team.member/team.end); the parent conversation/context still receives only the team's final joined summary (gauntlet-ACP: accept client-provided streaming-HTTP MCP servers #7 isolation preserved).Shipped
eccc91f— inline Task subagent visibility (the MVP: live/expanded/resolved on the Task card)83eca21—Teamtool backend (form-a-team as an agent operation; model-specified roster; redaction projection; factory unified with the gRPC team path)6db43e7— inline team rendering on the Team card (per-member lanes: aligned columns, lead-anchored,✎mutating cue,…heartbeat, lane cap + roll-up, expanded per-member traces with bounded previews)Each went through architect + UX design and a multi-axis panel review (spec/standards/security/duplication/UX).
Deferred (open)
ctrl+ahierarchy-overlay panel — the review's recommendation is to add it only once teams routinely exceed ~6 members (the inline card caps at 6 +· +K moretoday). Tracking this as the remaining piece.feat(mecatui): per-member context meter in the ctrl+a agents panel (#1)
feat(mecatui): t task sub-view in the ctrl+a agents panel (#1)
feat(mecatui): live-team footer summary segment (#1)
JAORMX commentedon Jun 1, 2026
Closing — the 4-phase plan is fully implemented
All four phases of the agent-hierarchy plan are now on
main.Phases 1–3 (inline Task visibility, team consumption + roster, the
ctrl+aagents overlay) landed earlier ineccc91f,83eca21,6db43e7,1f26bf6.The remaining Phase-4 / polish gaps shipped in three commits, each through an approach → implement → multi-axis panel review (spec / standards / architecture) → iterate → commit loop:
7c78f53— per-member context meter in thectrl+aoverlay:↑X ↓Y · ctx ▓▓▓▒░░░ NN% [⚠] · used/window, reusing the Tier-ArenderContextMeterincl. the danger mark. Filled the denominator the issue flagged as missing — the member engine's window + current occupancy ride theteam.*event path the overlay actually renders from (notTeamMember/ListTeam). "used" is the latest turn's input tokens, matching the main meter; gated on a known window.82d116a— thettask sub-view: flips the panel to the shared task list (id · state · assignee · deps) with aN done · N in-progress · N pending(N blocked)summary and glyph-coded states (✓/◆/○/⊘). Since the team is aTeam-tool-local object not addressable viaListTeamfrom the TUI, the task list streams as a first-classteam.tasksevent, consistent with the overlay's event-only render model.9d9d9a6— the live-team footer summary:⟳ team-<id> · k/N working · ctrl+a agents, width-tiered (full → id-less medium → compact) and yielding priority to the context meter on narrow widths; disappears when the team ends. Pure-UI;k/Nreuses the same!lane.donepredicate that drives the roster glyphs so the two can't disagree.Layering held throughout (domain → adapter → proto → client → ui, inward only;
ui/clientfree ofinternal/…/proto).task lint && task testgreen,cmd/mecademoprints a full offline session.Closing as completed.
feat(governance): memory + soul pre-approved-but-explicit at the buil…
docs: sharpen kit definition from validation panel + multi-tenancy
test(e2e): guardrails slot-enable live scenario (#159)
fix(scheduler): panel-review fixes — singleton trial-lease, read-lean…
feat(scheduler): tick loop + leader-lease + fire seam (#189, phase 1e)
7 remaining items
fix(subagent): close the review findings on the failure-cause + faile…
fix(subagent): surface a failed delegation's real cause, and make a t…
fix(posture): gate subagent shell on workspace trust, make TrustProje…
fix(posture): root-aware project trust for headless scheduler runs (#359
fix(agent): bind schedule origin to run context
fix(agent): bind schedule origin to run context
fix(steer): round-2 rework — mutex inbox (drop supersede) + clean-exi…
fix(steer): round-2 rework — mutex inbox (drop supersede) + clean-exi…
docs(steer): drop process-tag citations from production godocs