-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Problem (one or two sentences)
Summary
There are user-triggerable paths where returning to a parent task after delegation fails because the active child task is popped via removeClineFromStack() without any delegation-aware unwind semantics. This can leave the parent task orphaned in a delegated state with awaitingChildId still set, and the user ends up with an empty chat and no way to recover the parent task without manual history repair.
Why this matters
These are normal UI actions, not edge-case runtime failures. A user who clears a delegated child task will see an empty chat with no way to recover the parent task. The system is left in an unrecoverable delegation state without manual history repair.
Suggested direction (minimal)
A delegation-aware unwind chokepoint would allow consistent semantics whenever the active task is popped, rather than relying on each caller of removeClineFromStack() to implement delegation return or repair. No architectural sermon, no 600-line refactor — just a crisp invariant that needs holding. If maintainers want a PR, happy to discuss.
Context (who is affected and when)
Any user who triggers a UI action (Clear Task, navigate to history, or start a new task) while a delegated child task is active.
Reproduction steps
Start a parent task that delegates to a child task
While the child task is active, click "Clear Task"
Observe: child is removed, parent remains in delegated state, user sees empty chat with no way to recover parent task
Expected result
Parent task is restored or delegation is explicitly resolved/cancelled. UI remains in a valid active task state.
Actual result
removeClineFromStack() pops the child without restoring the parent's delegation state. Parent is left orphaned in delegated with stale awaitingChildId, user sees an empty chat with no recovery path.
Variations tried (optional)
Same orphaning occurs via two additional paths:
Navigate to a different task from history while child is active (showTaskWithId → createTaskWithHistoryItem → removeClineFromStack())
Start a new top-level task while child is running (createTask → removeClineFromStack())
App Version
v3.47.3
API Provider (optional)
None
Model Used (optional)
N/A
Roo Code Task Links (optional)
No response