Skip to content

Document worktree-creation failure UX in in-app docs#798

Merged
selfcontained merged 1 commit into
mainfrom
docs/worktree-failure-ux
Jul 19, 2026
Merged

Document worktree-creation failure UX in in-app docs#798
selfcontained merged 1 commit into
mainfrom
docs/worktree-failure-ux

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

What was audited

Docs-audit run scoped to next_focus: the in-app Worktrees docs section (apps/web/src/components/app/docs-sections/worktrees.tsx) against apps/server/src/shared/git/worktree.ts, following the concurrent-create .git/config lock fix in #794.

Verified every existing claim against source and found them all accurate:

  • "Create managed git worktree" checkbox default-on (createUseWorktree = useState(true)), disabled + noted when not a git repo.
  • .env copy + dependency install across pnpm-lock.yaml / yarn.lock / package-lock.json / bun.lockb (workspace-prep.ts, setup-script.ts).
  • Branch options: "Starting branch" dropdown, "Create a new branch" checkbox default-on and remembered per working directory (createNewBranchPrefAtom, atomWithLocalStorage keyed by cwd), auto-generated name when blank.
  • Worktree location (sibling default vs .dispatch/worktrees/), cleanup logic, and parallel-agent isolation (now reliably true post-Fix .git/config lock race when creating worktrees concurrently #794).

What changed

Added a "When creation fails" paragraph — the one genuine gap. This path is user-visible but was undocumented: because the user explicitly asked for an isolated worktree, Dispatch refuses to fall back to the main checkout. On failure the agent is marked stopped with the git error in last_error (surfaced as an Attention badge tooltip + Last error field on the card, per manager.ts and agent-card.tsx), and any partial worktree/branch is cleaned up so a relaunch starts clean. This resolves the long-standing backlog item from #409.

Deferred to next run

  • Next focus: audit docs-pane Status Events / Notifications sections against source.
  • Backlog retains the callable-jobs palette UI regression and other pre-existing items.

🤖 Generated with Claude Code

The Worktrees docs section explained creation, branch options, location,
and cleanup, but never covered what a user sees when worktree creation
fails. That path is user-visible: since the user explicitly asked for an
isolated worktree, Dispatch refuses to fall back to the main checkout —
it marks the agent stopped with the git error in `last_error` (surfaced
as an Attention badge + "Last error" field on the card) and cleans up any
partial worktree/branch so a relaunch starts clean.

Verified against setup-script.ts (failure branch), manager.ts
(setAgentStatus stopped + "Worktree creation failed: …" last_error), and
agent-card.tsx (Attention badge tooltip + Last error meta).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@selfcontained
selfcontained merged commit ad37af7 into main Jul 19, 2026
1 check passed
@selfcontained
selfcontained deleted the docs/worktree-failure-ux branch July 19, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant