Skip to content

fix(tui): improve subagent display and timer tracking#282

Merged
echobt merged 1 commit intomasterfrom
fix/tui-subagent-display-improvements
Jan 27, 2026
Merged

fix(tui): improve subagent display and timer tracking#282
echobt merged 1 commit intomasterfrom
fix/tui-subagent-display-improvements

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 27, 2026

Summary

This PR fixes several issues with the TUI when subagents (Task tool) are running:

Changes

  1. Todo list visibility: Main agent and subagents are now instructed to use TodoWrite tool for real-time progress visibility

    • Added Todo List section to main system prompt requiring TodoWrite usage for multi-step tasks
    • Enabled TodoWrite/TodoRead tools for subagents (only Task is disabled to prevent recursion)
    • Updated subagent system prompt to require immediate TodoWrite usage
  2. Delegation indicator: Shows 'Delegation' status when a subagent is running instead of 'Working'

    • Added is_delegating flag to StreamingState
    • Status indicator now shows 'Delegation' when subagents are active
  3. Timer tracking: Shows total time from last user prompt instead of per-task timer

    • Added prompt_started_at that persists across streaming restarts
    • Uses prompt_elapsed_seconds() for consistent elapsed time display
    • Added full_reset() to clear timer only when entire conversation turn is complete
  4. Task visibility: Keeps Task display visible after completion (cleared on next conversation turn)

    • Subagents are no longer removed from active_subagents on completion
    • They remain visible with Completed/Failed status
    • Cleared only when user sends a new message

Testing

  • Cargo check passes with no errors
  • Cargo fmt passes

Changes:
- Force main agent and subagents to use TodoWrite tool for progress visibility
- Show 'Delegation' status indicator when subagent is running
- Use total time from last user prompt instead of per-task timer
- Keep Task display visible after completion (cleared on next turn)
- Add prompt_started_at tracking for consistent elapsed time display
- Enable TodoWrite/TodoRead tools for subagents (only Task disabled)

Fixes issues with:
- Subagent todo list not visible in real-time
- Loading indicator not shown during agent delegation
- Timer resetting per task instead of showing total duration
- Task label disappearing immediately after completion
@echobt echobt merged commit 1868c8c into master Jan 27, 2026
2 of 3 checks passed
@echobt echobt deleted the fix/tui-subagent-display-improvements branch January 27, 2026 14:41
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.

2 participants