fix(worker): keep interactive & planning prompts intact past Windows Terminal

wt.exe treats ';' as a command/tab delimiter in every argument, with no escape
that survives quoting (microsoft/terminal#13264), so a task description
containing ';' spawned extra terminals on "Run interactively" and planning start.
Route the launch as wt -> powershell -> claude and pass the free-text prompt via
$env:CLAUDEDO_LAUNCH_PROMPT so it never reaches the wt command line; PowerShell
binds the variable as a single argument (embedded quotes escaped for PS 5.1).

Also clarify the launcher, which serves interactive runs too (not just planning):
IPlanningTerminalLauncher -> ITerminalLauncher, WindowsTerminalPlanningLauncher ->
WindowsTerminalLauncher, LaunchStart/Resume -> LaunchPlanning{Start,Resume}Async.
This commit is contained in:
Mika Kuns
2026-06-26 16:11:49 +02:00
parent f86b78593e
commit ea16da2756
9 changed files with 233 additions and 206 deletions
+5 -5
View File
@@ -102,7 +102,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
private readonly TaskResetService _resetService;
private readonly TaskMergeService _mergeService;
private readonly PlanningSessionManager _planning;
private readonly IPlanningTerminalLauncher _launcher;
private readonly ITerminalLauncher _launcher;
private readonly PlanningAggregator _planningAggregator;
private readonly PlanningMergeOrchestrator _planningMergeOrchestrator;
private readonly PlanningChainCoordinator _planningChain;
@@ -127,7 +127,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
TaskResetService resetService,
TaskMergeService mergeService,
PlanningSessionManager planning,
IPlanningTerminalLauncher launcher,
ITerminalLauncher launcher,
PlanningAggregator planningAggregator,
PlanningMergeOrchestrator planningMergeOrchestrator,
PlanningChainCoordinator planningChain,
@@ -533,9 +533,9 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
var ctx = await _planning.StartAsync(taskId, Context.ConnectionAborted);
try
{
await _launcher.LaunchStartAsync(ctx, Context.ConnectionAborted);
await _launcher.LaunchPlanningStartAsync(ctx, Context.ConnectionAborted);
}
catch (PlanningLaunchException)
catch (TerminalLaunchException)
{
// Launch failed before any children could be created; force-cleanup is safe.
await _planning.DiscardAsync(taskId, dequeueQueuedChildren: true, Context.ConnectionAborted);
@@ -548,7 +548,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
public async Task<PlanningSessionResumeContext> ResumePlanningSessionAsync(string taskId)
{
var ctx = await _planning.ResumeAsync(taskId, Context.ConnectionAborted);
await _launcher.LaunchResumeAsync(ctx, Context.ConnectionAborted);
await _launcher.LaunchPlanningResumeAsync(ctx, Context.ConnectionAborted);
return ctx;
}