fix(worker,ui): clean up three review leftovers from the list-handler run
Remove the redundant TaskUpdated broadcast in TaskRunner.ContinueAsync's queue-claim path, consolidate InteractiveLaunchSpecService's seven MCP_TOOL_TIMEOUT literals into one constant (fixing the merge-helper handoff spec's stale 200000ms value), and surface OpenQuickClaudeSession's two failure cases via ErrorReported/footer instead of a silent no-op, with a less ambiguous icon.
This commit is contained in:
@@ -242,7 +242,7 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable
|
||||
Assert.Equal(_worktreeDir, spec.Cwd);
|
||||
Assert.Equal(_claudeStubPath, spec.Exe);
|
||||
Assert.Equal(new[] { "--resume", "sess-123" }, ArgsAfterEffort(spec));
|
||||
Assert.Equal("930000", spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
Assert.Equal(InteractiveLaunchSpecService.McpToolTimeoutMs, spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -401,7 +401,7 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable
|
||||
Assert.Equal(_tempDir, spec.Cwd);
|
||||
Assert.Equal(_claudeStubPath, spec.Exe);
|
||||
Assert.Empty(ArgsAfterEffort(spec));
|
||||
Assert.Equal("930000", spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
Assert.Equal(InteractiveLaunchSpecService.McpToolTimeoutMs, spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
Assert.Empty(_seeder.Calls);
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable
|
||||
Assert.Contains(briefPath, kickoff);
|
||||
Assert.DoesNotContain('\n', kickoff);
|
||||
|
||||
Assert.Equal("930000", spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
Assert.Equal(InteractiveLaunchSpecService.McpToolTimeoutMs, spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -791,7 +791,7 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable
|
||||
Assert.Contains(survivor, handoffBrief);
|
||||
Assert.Contains("phase 3", handoffBrief, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
Assert.Equal("200000", spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
Assert.Equal(InteractiveLaunchSpecService.McpToolTimeoutMs, spec.Env["MCP_TOOL_TIMEOUT"]);
|
||||
}
|
||||
|
||||
private async Task<int> CountTasksAsync()
|
||||
@@ -841,4 +841,57 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable
|
||||
Assert.Equal("tok-2", spec.Env["CLAUDEDO_PLANNING_TOKEN"]);
|
||||
Assert.Equal(_worktreeDir, spec.Cwd);
|
||||
}
|
||||
|
||||
// Regression guard for the bug where BuildForMergeHelperHandoffAsync set MCP_TOOL_TIMEOUT to
|
||||
// an older, shorter value (200000) than every other ConPTY spec (930000) after a parallel
|
||||
// merge landed the two changes independently. Every spec this service builds must carry the
|
||||
// SAME value, sourced from the one constant, so the value can never drift again.
|
||||
[Fact]
|
||||
public async Task AllBuiltSpecs_CarryTheSameMcpToolTimeout()
|
||||
{
|
||||
var repo = Path.Combine(_tempDir, "repoTimeoutCheck");
|
||||
Directory.CreateDirectory(repo);
|
||||
|
||||
var listId = await SeedListAsync(workingDir: repo, name: "Alpha");
|
||||
var taskId = Guid.NewGuid().ToString();
|
||||
await SeedTaskAsync(taskId, listId, TaskStatus.Idle);
|
||||
await SeedWorktreeAsync(taskId, WorktreeState.Active);
|
||||
await SeedRunAsync(taskId, "sess-timeout-check");
|
||||
|
||||
var handlerTaskId = Guid.NewGuid().ToString();
|
||||
await SeedTaskAsync(handlerTaskId, listId, TaskStatus.Idle, title: "Handler");
|
||||
var survivor = Guid.NewGuid().ToString();
|
||||
await SeedTaskAsync(survivor, listId, TaskStatus.WaitingForReview, title: "Survivor");
|
||||
|
||||
var sessionDir = Path.Combine(_tempDir, "sess-timeout-check");
|
||||
Directory.CreateDirectory(sessionDir);
|
||||
var planningStartCtx = new PlanningSessionStartContext(
|
||||
ParentTaskId: "p1", WorkingDir: _worktreeDir, Token: "tok-1",
|
||||
WorktreePath: _worktreeDir, BranchName: "claudedo/planning/p1",
|
||||
Files: new PlanningSessionFiles(sessionDir,
|
||||
Path.Combine(sessionDir, "system-prompt.md"),
|
||||
Path.Combine(sessionDir, "initial-prompt.txt")));
|
||||
var planningResumeCtx = new PlanningSessionResumeContext(
|
||||
ParentTaskId: "p1", WorkingDir: _worktreeDir,
|
||||
ClaudeSessionId: "sess-42", Token: "tok-2", WorktreePath: _worktreeDir);
|
||||
|
||||
var svc = BuildService();
|
||||
var mergeHelperSpec = await svc.BuildForMergeHelperAsync(new[] { survivor }, listId, CancellationToken.None);
|
||||
TrackSessionDir(mergeHelperSpec);
|
||||
var handoffSpec = await svc.BuildForMergeHelperHandoffAsync(handlerTaskId, new[] { survivor }, CancellationToken.None);
|
||||
TrackSessionDir(handoffSpec);
|
||||
|
||||
var specs = new List<LaunchSpec>
|
||||
{
|
||||
await svc.BuildForTaskAsync(taskId, CancellationToken.None),
|
||||
await svc.BuildForDirectoryAsync(_tempDir, CancellationToken.None),
|
||||
mergeHelperSpec,
|
||||
handoffSpec,
|
||||
svc.BuildPlanningStart(planningStartCtx),
|
||||
svc.BuildPlanningResume(planningResumeCtx),
|
||||
};
|
||||
|
||||
Assert.All(specs, spec =>
|
||||
Assert.Equal(InteractiveLaunchSpecService.McpToolTimeoutMs, spec.Env["MCP_TOOL_TIMEOUT"]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user