feat(planning): run interactive planning sessions via embedded ConPTY
Planning start/resume opened an external Windows Terminal (wt) window. Route them through the embedded ConPTY Command Center pane instead, matching the existing interactive-session UX (no external window). - Extract bare planning arg builders (BuildPlanningStartArgs/ResumeArgs) from WindowsTerminalLauncher; the wt path still uses them (kept, not removed). - InteractiveLaunchSpecService.BuildPlanningStart/Resume map a planning context into a LaunchSpec (planning args + env: MAX_THINKING_TOKENS, CLAUDEDO_PLANNING_TOKEN). Hub GetPlanningStart/ResumeLaunchSpec run StartAsync/ResumeAsync then return the spec. - UI: OpenPlanningSession + the resume branch raise OpenPlanningConPtyRequested; the shell opens Mission Control and hosts a planning ConPTY pane. Env is process-global by design (sequential human-paced sessions). wt planning code retained. Tests added for the arg/env mapping.
This commit is contained in:
@@ -70,6 +70,31 @@ public sealed class WindowsTerminalLauncherTests
|
||||
Assert.DoesNotContain("CLAUDEDO_LAUNCH_PROMPT", command);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildPlanningStartArgs_HasPlanningFlagsAndKickoffLast()
|
||||
{
|
||||
var ctx = MakeStartCtx();
|
||||
|
||||
var args = WindowsTerminalLauncher.BuildPlanningStartArgs(ctx);
|
||||
|
||||
Assert.Equal("--model", args[0]);
|
||||
var permIdx = args.ToList().IndexOf("--permission-mode");
|
||||
Assert.True(permIdx >= 0);
|
||||
Assert.Equal("plan", args[permIdx + 1]);
|
||||
Assert.Contains("--allowedTools", args);
|
||||
Assert.Contains(ctx.Files.SessionDirectory, args);
|
||||
Assert.Contains(ctx.Files.SystemPromptPath, args);
|
||||
// Kickoff positional is the last token and points at the brief file.
|
||||
Assert.Contains(ctx.Files.InitialPromptPath, args[^1]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildPlanningResumeArgs_PinsPlanModeAndResume()
|
||||
{
|
||||
var args = WindowsTerminalLauncher.BuildPlanningResumeArgs("sess-9");
|
||||
Assert.Equal(new[] { "--permission-mode", "plan", "--resume", "sess-9" }, args);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildResumeCommand_ResumesSessionSingleQuoted()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user