-
Notifications
You must be signed in to change notification settings - Fork 207
Description
Problem
When an agent working on a bead creates new beads within the same epic (e.g., via br create), those new beads don't appear in the TUI task list until the user manually presses r to refresh.
The engine's execution loop already re-queries the tracker each iteration (via getNextTask() and isComplete()), so new beads are picked up for execution — the problem is purely that the TUI task list doesn't update to show them.
This makes the TUI feel out of sync with reality, especially for workflows where agents dynamically create subtasks.
Expected behavior
After a task completes, the TUI should automatically refresh the task list to show any new beads the agent may have created.
Current behavior
New beads only appear after manually pressing r.
Affected modes
- Single mode (sequential execution)
- Parallel mode (worker-based execution)
Proposed solution
Reuse the existing engine.refreshTasks() → tasks:refreshed event → setTasks() pipeline that the r key already triggers:
- Single mode: Call
refreshTasks()after task completion in the engine loop - Parallel mode: Query the tracker after
worker:completedandmerge:completedevents, with a 2s debounce to avoid hammering the tracker when multiple workers finish simultaneously - Bonus: Fix the
rkey to also work in parallel mode (currently requiresenginewhich doesn't exist in parallel mode)
This approach works with all tracker types (beads, beads-rust, beads-bv, json) since it operates at the BaseTrackerPlugin level via the abstract getTasks() method.