feat(worker): resume a task's claude session in a terminal

This commit is contained in:
Mika Kuns
2026-07-23 16:47:13 +02:00
committed by mika kuns
parent 865e12c0de
commit 140ae2fda1
5 changed files with 176 additions and 1 deletions
@@ -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);
}
}