fix(worker): seed planning brief via file to avoid newline truncation
This commit is contained in:
@@ -45,4 +45,28 @@ public sealed class WindowsTerminalLauncherTests
|
||||
sut.LaunchPlanningStartAsync(ctx, CancellationToken.None));
|
||||
Assert.Contains("Windows Terminal", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildPlanningStartCommand_SeedsViaBriefFile_NotInlineText()
|
||||
{
|
||||
var ctx = MakeStartCtx();
|
||||
|
||||
var command = WindowsTerminalLauncher.BuildPlanningStartCommand("claude.exe", ctx);
|
||||
|
||||
// The brief is read from a file: the kickoff references the brief path, and its
|
||||
// directory is exposed via --add-dir so the Read tool can open it.
|
||||
Assert.Contains(ctx.Files.InitialPromptPath, command);
|
||||
Assert.Contains($"--add-dir' '{ctx.Files.SessionDirectory}", command);
|
||||
|
||||
// The positional kickoff must follow the single-value --append-system-prompt-file
|
||||
// flag, or a preceding variadic flag would swallow it.
|
||||
var appendIdx = command.IndexOf("--append-system-prompt-file", StringComparison.Ordinal);
|
||||
var addDirIdx = command.IndexOf("--add-dir", StringComparison.Ordinal);
|
||||
Assert.True(appendIdx > addDirIdx, "--append-system-prompt-file must come after --add-dir");
|
||||
Assert.True(command.IndexOf(ctx.Files.InitialPromptPath, StringComparison.Ordinal) > appendIdx,
|
||||
"the kickoff prompt must be the last (positional) token");
|
||||
|
||||
// The legacy env-var indirection is gone.
|
||||
Assert.DoesNotContain("CLAUDEDO_LAUNCH_PROMPT", command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user