feat(queue): warn when the base branch has uncommitted changes

Queuing (update_task_status, batch_update_task_status) and run_task_now
now surface a non-blocking baseDirty warning (separate modified/untracked
counts) when the list's working dir has uncommitted changes at enqueue
time, since a new worktree forks from the commit tip and silently misses
them. BaseDirtyChecker caches per working dir for a few seconds so a
batch queue over many tasks in one list only shells out to git once. The
UI surfaces the same warning via the footer error strip on queue actions.
This commit is contained in:
mika kuns
2026-08-10 14:30:33 +02:00
parent 6a2a19cc9e
commit d3155e6868
23 changed files with 481 additions and 32 deletions
@@ -1,4 +1,5 @@
using ClaudeDo.Data;
using ClaudeDo.Worker.Git;
using ClaudeDo.Worker.Hub;
using ClaudeDo.Worker.Planning;
using ClaudeDo.Worker.Queue;
@@ -21,7 +22,9 @@ public static class TaskStateServiceBuilder
RunCancellationRegistry RunCancels);
public static Built Build(
IDbContextFactory<ClaudeDoDbContext> dbFactory, Func<IActiveMergeState>? mergeState = null)
IDbContextFactory<ClaudeDoDbContext> dbFactory,
Func<IActiveMergeState>? mergeState = null,
IBaseDirtyChecker? baseDirtyChecker = null)
{
var hub = new CapturingHubContext();
var broadcaster = new HubBroadcaster(hub);
@@ -37,6 +40,7 @@ public static class TaskStateServiceBuilder
chain,
runCancels,
mergeState ?? (() => NoActiveMergeState.Instance),
baseDirtyChecker ?? new BaseDirtyChecker(new ClaudeDo.Data.Git.GitService(), NullLogger<BaseDirtyChecker>.Instance),
NullLogger<TaskStateService>.Instance);
return new Built(state, chain, hub, () => waker.Count, waker, runCancels);