feat(worker): resume a task's claude session in a terminal
This commit is contained in:
@@ -69,4 +69,27 @@ public sealed class WindowsTerminalLauncherTests
|
||||
// The legacy env-var indirection is gone.
|
||||
Assert.DoesNotContain("CLAUDEDO_LAUNCH_PROMPT", command);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildResumeCommand_ResumesSessionSingleQuoted()
|
||||
{
|
||||
var command = WindowsTerminalLauncher.BuildResumeCommand("claude.exe", "sess-42");
|
||||
|
||||
Assert.Contains("--resume", command);
|
||||
// The session id is single-quoted so ';' and friends pass through untouched.
|
||||
Assert.Contains("'--resume' 'sess-42'", command);
|
||||
// A plain resume drives the real interactive TUI — no planning-only flags.
|
||||
Assert.DoesNotContain("--permission-mode", command);
|
||||
Assert.DoesNotContain("--append-system-prompt-file", command);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LaunchResumeAsync_WorkingDirMissing_Throws()
|
||||
{
|
||||
var sut = new WindowsTerminalLauncher(wtPath: "wt", claudePath: "claude");
|
||||
var missing = Path.Combine(Path.GetTempPath(), "nonexistent_" + Guid.NewGuid());
|
||||
var ex = await Assert.ThrowsAsync<TerminalLaunchException>(() =>
|
||||
sut.LaunchResumeAsync(missing, "sess-1", CancellationToken.None));
|
||||
Assert.Contains("Working directory", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user