Import
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | auto-generated | Optional stable id for tracking and deduping. |
path | string | — | Filesystem path for the JJ workspace root. Required; non-empty. |
branch | string | undefined | Git/JJ branch name to check out in the worktree. When omitted, the worktree uses the current branch. |
skipIf | boolean | false | Skip the subtree when true. |
children | ReactNode | — | Nested tasks and control-flow nodes. |
Basics
<Worktree> receive worktreeId and a normalized absolute worktreePath in their task descriptors. The engine uses this worktreePath as the cwd for JJ operations and as the task root when executing tools.
Path Resolution
- Relative
pathvalues resolve against the workflow’s base directory (enginebaseRootDirwhen provided, otherwiseprocess.cwd()). - Absolute paths are preserved and normalized.
- Empty or whitespace-only
pathis rejected:<Worktree> requires a non-empty path prop.
Nesting
Nested<Worktree> components are supported. The innermost worktree in scope for a task determines its effective worktreeId/worktreePath.
With Parallel and MergeQueue
Worktrees compose with concurrency primitives. For example, queue serialized patch application inside a dedicated workspace:Rendering Internals
- Renders to a
<smithers:worktree>host node. - Extraction assigns
worktreeIdandworktreePathto every descendant task descriptor. - The scheduler remains unaware of worktrees; the engine consumes these fields to scope JJ operations and reverts.
Notes
- Duplicate
idvalues are rejected. - Prefer absolute, ephemeral paths for isolation when running CI.
- Relative paths aid portability for local development.