Skip to content

fix: classify TUI attention over the whole store, not the newest 300 (#220) - #253

Open
mikehasa wants to merge 3 commits into
mainfrom
fix/tui-attention-truncation-220
Open

mikehasa wants to merge 3 commits into
mainfrom
fix/tui-attention-truncation-220

Conversation

@mikehasa

Copy link
Copy Markdown
Owner

Summary

Fixes #220: the TUI Dashboard could show "All clear" while a blocked task sat unresolved, and the Work pane could hide and make unsearchable any task older than the 300 most recent. This is a regression the #185 TUI rewrite reintroduced — the correct full-store attention pattern already exists in the API layer (the #152/#153 fix used by /v1/tasks and the GUI); the TUI just bypassed it. Reproduced against source, then fixed; tests verified pre-fix/post-fix.

Root cause

_build_dashboard() and _build_work() sort latest-first and slice to _RECEIPTS_LIMIT = 300 before attention classification / text filtering, and _build_dashboard_parts() equates an empty truncated attention set with "All clear". So a blocked task older than the 300 newest completed tasks never enters the classified set.

Fix (TUI presentation layer only; the API projection is unchanged)

  • Dashboard attention is computed over the whole store (reusing the existing api attention projection with its exact total + bounded preview), so a stale blocker surfaces and "All clear" shows only when the full queue is empty.
  • Work builds a row for every task so text search can reach an older blocker; only the display stays capped, and the Work head now discloses "showing 300 of N" when truncated.
  • Behavior is identical when the store holds ≤ 300 tasks.

Testing

  • New tests in test_tui.py: (1) 1 blocked + 300 newer → Dashboard is not "All clear" and the blocker surfaces; (2) the blocker is search-reachable and the head discloses "showing 300 of 301" under the latest sort; (3) a store under the cap still surfaces its blocker with no truncation disclosure (preserves current behavior). All three fail on the pre-fix source and pass on the fix.
  • Existing "All clear" empty-store and small-seed dashboard/work tests still pass.
  • Full suite: 2897 passed (PYTHONPATH=src .venv/bin/python -m pytest -q), on top of current main (0.10.10).

Fixes #220

mikehasa and others added 3 commits September 15, 2026 00:33
The TUI Dashboard and Work pane sorted latest-first and sliced to
_RECEIPTS_LIMIT (300) before classifying attention or filtering, and the
Dashboard equated an empty truncated attention set with "All clear". A blocked
task older than the 300 most recent was therefore dropped from attention (false
"All clear"), missing from the Work list, and unsearchable.

Dashboard attention is now computed over the full store (reusing the existing
api attention projection with its exact total and bounded preview), so a stale
blocker surfaces and "All clear" shows only when the whole queue is empty. Work
builds a row for every task so text search reaches an older blocker, keeps only
the display capped, and discloses "showing 300 of N" in the Work head when the
list is truncated. The api projection is unchanged; behavior is identical when
the store holds 300 tasks or fewer. (#220)
# Conflicts:
#	CHANGELOG.md
#	src/agentacct/tui.py
Main moved the receipts list to the Sessions tab (key 3; key 2 is now Work,
the worksets tab), so the two #220 scenarios pressed the wrong pane and saw
an empty list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: TUI silently drops tasks after the newest 300 and can report All clear with an unresolved blocker

1 participant