multica-ai/multica · error

local_directory worktree: wait for a consistent snapshot of

Error message

local_directory worktree: wait for a consistent snapshot of %s: %w

What it means

Wraps the failure to obtain a consistent snapshot of a local_directory resource before running the task: the daemon waits (marking the task 'waiting' in the UI) for the directory lock/checkout to settle, and that wait failed or was cancelled. Transient local activity (another task or the user writing the directory) is the usual cause, so a later dispatch can retry.

Solutions

  1. Wait for the local directory to settle, then retry the task.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at server/internal/daemon/daemon.go:6505 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/3c57952eab6eb8a1. Report an issue: GitHub.

Appendix: source

Thrown at server/internal/daemon/daemon.go:6505

				if waitErr := d.client.MarkTaskWaitingLocalDirectory(waitCtx, task.ID, reason); waitErr != nil {
					// Non-fatal: the wait still happens, the UI just won't
					// show the explicit "waiting" badge.
					taskLog.Warn("local_directory: mark waiting status failed", "error", waitErr)
				}
				cancelled := d.watchTaskCancellation(waitCtx, task.ID, pollInterval, taskLog)
				go func() {
					select {
					case <-cancelled:
						waitCancel()
					case <-waitCtx.Done():
					}
				}()
			})
			if waitCounted {
				d.resourceWaitTasks.Add(-1)
			}
			if lockErr != nil {
				return TaskResult{}, fmt.Errorf("local_directory worktree: wait for a consistent snapshot of %s: %w",
					localAssignment.AbsPath, lockErr)
			}
			env, err = d.prepareExecutionEnvironment(prepareCtx, prepParams)
			release()
			if err != nil {
				return TaskResult{}, fmt.Errorf("prepare execution environment: %w", err)
			}
		} else {
			if localAssignment != nil {
				prepParams.LocalWorkDir = localAssignment.AbsPath
			}
			env, err = d.prepareExecutionEnvironment(prepareCtx, prepParams)
			if err != nil {
				return TaskResult{}, fmt.Errorf("prepare execution environment: %w", err)
			}
		}
	}
	// Belt-and-suspenders: also mark whatever root we ended up with, in case

View on GitHub (pinned to 2c0912b6ec)