fix-tui-chat

Fix: TUI chat cleanup — closing tab hides only; tasks reappear; need delete/abandon from TUI

Metadata

Statusdone
Assignedagent-1334
Agent identity3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3
Modelclaude:sonnet
Created2026-05-01T14:39:02.607467309+00:00
Started2026-05-01T14:41:01.517091331+00:00
Completed2026-05-01T15:29:19.363380543+00:00
Tagspriority-high,bug,tui,ux,chat, eval-scheduled
Eval score0.73
└ blocking impact0.75
└ completeness0.75
└ coordination overhead0.80
└ correctness0.70
└ downstream usability0.70
└ efficiency0.80
└ intent fidelity0.75
└ style adherence0.75

Description

Description

The user has accumulated many chat tasks (.chat-N) that are mostly empty / unused. Closing a tab in the TUI hides it from the chat tab bar but doesn't remove the underlying task from the graph. Next time the TUI opens, the tabs reappear because the chat tasks are still in the graph.

User report 2026-05-01: 'we're not able to clean up tasks in the graph itself. So we have all these chat tasks now that are kind of floating, many of which are just empty. I know I can remove it from the command line, but in the TUI, I wish there were an easy way for me to remove it. ... So I have all these chat things that I remove from my view, but then they reappear every time I open the TUI.'

Two distinct concerns

A: Closing X on a chat tab should TRULY remove the chat

Currently: clicking ✕ on a chat tab removes it from the tab bar visually but leaves the chat task in the graph.

Better: clicking ✕ prompts 'Close this chat? [a]bandon (kill the agent + remove from graph) / [h]ide (just remove tab; task stays) / [esc] cancel'. Default = abandon, since 'I clicked X' usually means 'I'm done with this'.

OR even simpler: ✕ always abandons the chat task. If the user wants to hide-but-keep, that's a separate menu / action. Defaults match user mental model of 'X = gone for good'.

B: Existing accumulated chat tasks need a way to bulk-clean

Many empty chats already in the graph. The TUI should expose a list-view + multi-select + abandon action. Possibly a 'chat manager' pane that lists all .chat-* tasks with their status, last-message timestamp, message count, and bulk ops (abandon-all-empty, abandon-all-older-than-7d, etc.).

Validation

  • Failing test: clicking X on a chat tab abandons the underlying task (default behavior). Pre-fix: task remains in graph. Post-fix: task is abandoned.
  • Live smoke: open TUI, click X on a chat tab, verify wg show .chat-N shows status=abandoned. Reopen TUI, confirm tab does NOT reappear.
  • Bulk cleanup interface (chat manager pane / dialog): exists, lists all chat tasks, supports multi-select abandon
  • Filter/sort: by age, by message-count, by status (filter to empty chats specifically)
  • No regression: chats currently in-progress (with active agent) are NOT accidentally abandoned just because the user clicks X — confirm the abandon path kills the agent cleanly first
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done

Depends on

Required by

Log