fix(ui): close interactive-session gate bypasses in reset-and-retry and plan queueing
Reset & Retry discarded the branch and queued an autonomous run even while the user had an interactive ConPTY pane open on the task, and finalizing a plan queued every child unconditionally (the hub has no notion of a UI-hosted session) — both bypassed the HasInteractiveSession gate added for CanSendToQueue. CanResetAndRetry now checks it too, with a subscription on the bound task so the command re-evaluates when the flag flips without Task itself changing; SendToQueueAsync now blocks queuing the whole plan and surfaces the affected child titles when any child has an open session.
This commit is contained in:
@@ -837,6 +837,19 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
// A finalized planning parent queues its plan (children sequentially), not itself.
|
||||
if (row.CanQueuePlan)
|
||||
{
|
||||
// The hub's QueuePlanningSubtasksAsync queues every Idle child unconditionally — it has
|
||||
// no notion of a UI-hosted ConPTY session. Block the whole plan if any child has one open,
|
||||
// otherwise that child's worktree would get an autonomous run racing the user's own edits.
|
||||
var interactiveChildren = Items
|
||||
.Where(r => r.ParentTaskId == row.Id && r.HasInteractiveSession)
|
||||
.Select(r => r.Title)
|
||||
.ToList();
|
||||
if (interactiveChildren.Count > 0)
|
||||
{
|
||||
ErrorReported?.Invoke(Loc.T(
|
||||
"vm.tasksIsland.queuePlanBlockedInteractive", string.Join(", ", interactiveChildren)));
|
||||
return;
|
||||
}
|
||||
await QueuePlanningSubtasksAsync(row);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user