tui: drill into a sidebar agent's detail card from the expanded dossier (dogfood A3) - #4234
Conversation
Dogfood finding A3 (#4092), first #2889 slice: the Agents sidebar showed truncated rows with no way to drill into what a child is doing. Clicking an agent label row still toggles the inline dossier. The expanded dossier rows (detail line and the full-output handle line) now register a new SidebarRowAction::OpenAgentDetail, which opens the child's transcript card — action tree, status, final summary — in the existing detail pager (open_details_pager_for_cell). When no transcript card exists yet, the status line points at the handle_read var handle instead of failing silently. Scope note: this is the narrow drill-in slice. #2889's structured row model + hover-popover-always work stays open for the community pass; the row hover dossier already exists and is unchanged. Tests: subagent_expanded_dossier_rows_register_open_agent_detail (new); two existing action-layout tests updated to the clickable dossier. Sidebar module: 90 pass; mouse module: 56 pass.
|
Claude finished @Hmbown's task in 4m 25s —— View job Review complete
SummaryThis is a clean, well-scoped slice: Correctness — one real bug
let cell_index = app.history.iter().position(|cell| {
matches!(cell, HistoryCell::SubAgent(SubAgentCell::Delegate(card)) if card.agent_id == agent_id)
});Agents spawned via the fanout dispatch path ( The existing let cell_index = app.subagent_card_index.get(&agent_id).copied();That also drops the Provider/model route safetyNo provider/model prefix inference here — not applicable to this change. Tests
NoteI wasn't able to run |
| let cell_index = app.history.iter().position(|cell| { | ||
| matches!( | ||
| cell, | ||
| HistoryCell::SubAgent( | ||
| crate::tui::history::SubAgentCell::Delegate(card) | ||
| ) if card.agent_id == agent_id | ||
| ) | ||
| }); |
There was a problem hiding this comment.
Correctness: fanout worker agents can never be drilled into.
This scan only matches SubAgentCell::Delegate, so any agent spawned through the fanout path (rlm_open/rlm_eval/rlm dispatch → SubAgentCell::Fanout(FanoutCard), see subagent_routing.rs:392-417) will never be found here, even though its transcript card genuinely exists inside the FanoutCard. Clicking the expanded dossier for such an agent always falls into the None branch and shows "No transcript card for {agent_id} yet…" — which is misleading since the card is there.
The row action is registered unconditionally in sidebar.rs::subagent_panel_rows (no Delegate/Fanout distinction), so this is reachable for real fanout workers, not just delegates.
This also reimplements — with a linear O(n) scan over app.history — a lookup that already exists and is used for exactly this purpose (both Delegate and Fanout) at subagent_routing.rs:362:
if let Some(&idx) = app.subagent_card_index.get(&agent_id) { ... }Suggest reusing it directly instead of re-deriving the index by scanning history:
| let cell_index = app.history.iter().position(|cell| { | |
| matches!( | |
| cell, | |
| HistoryCell::SubAgent( | |
| crate::tui::history::SubAgentCell::Delegate(card) | |
| ) if card.agent_id == agent_id | |
| ) | |
| }); | |
| let cell_index = app.subagent_card_index.get(&agent_id).copied(); |
This fixes the fanout gap and drops the linear scan, matching the existing lookup pattern used elsewhere in this file (app.subagent_card_index).
mouse_ui.rs already imports open_details_pager_for_cell through the ui.rs re-export; drop the fully-qualified path and the now-unneeded module visibility widening.
|
Claude finished @Hmbown's task in 58s —— View job Re-review after new commit
SummaryThe new commit ( Outstanding: the fanout correctness bug from the previous review is still unfixed
let cell_index = app.history.iter().position(|cell| {
matches!(cell, HistoryCell::SubAgent(SubAgentCell::Delegate(card)) if card.agent_id == agent_id)
});This still only matches let cell_index = app.subagent_card_index.get(&agent_id).copied();Suggest making this swap before merging — it fixes the fanout gap and replaces the |
Summary
Dogfood finding A3 on #4092 — Agents sidebar rows were truncated and not drillable. Narrow first slice of #2889 (which stays open for @aboimpinto's structured-model pass):
SidebarRowAction::OpenAgentDetailopens the child's transcript card (action tree, status, final summary) in the existing detail pager viaopen_details_pager_for_cell.handle_read agent:<id>/full_transcriptinstead of failing silently.Testing
subagent_expanded_dossier_rows_register_open_agent_detailtui::sidebar: 90 pass; mouse module: 56 pass; fmt + CI-flag clippy clean