Skip to content

[Feature]: Support --workspace worktree:<path> + --branch for controlled kanban worktree placement #26485

@ddiall

Description

@ddiall

Problem

When using kanban create --workspace worktree, the dispatcher resolves the worktree path as Path.cwd() / ".worktrees" / task.id (line 2667-2670 of kanban_db.py). Since the gateway process CWD varies between starts, worktrees end up in unpredictable locations:

~/.hermes/hermes-agent/.worktrees/           (gateway from hermes-agent dir)
~/projects/anamnesis/.worktrees/             (gateway from anamnesis dir)
~/.hermes/services/hermes-webui-cn/repo/.worktrees/  (gateway from webui dir)

Additionally, the auto-generated branch name is wt/t_<task_id> which is opaque in git history.

Requested Features

1. --workspace worktree:<path> syntax

Mirror the existing --workspace dir:<path> pattern so users can pin worktree placement:

hermes kanban create "..." --workspace worktree:~/projects/anamnesis/.worktrees/t6-wire

The code already supports this — resolve_workspace() in kanban_db.py uses task.workspace_path when set. The CLI just needs to parse worktree:<path> the same way it parses dir:<path>.

2. --branch <name> flag for meaningful git history

hermes kanban create "..." --workspace worktree --branch wt/t6-wire

The worker would use this branch name when creating the worktree instead of auto-generating wt/t_<task_id>. This makes git log --all show meaningful branch names like wt/t6-wire instead of wt/t_ac4b381c.

Impact

Without this, kanban multi-wave parallelism with worktrees requires manual workarounds: workers renaming branches via git branch -m in task bodies, verifying workspace paths match expectations, etc.

Implementation Notes

  • hermes_cli/kanban.py WorkspaceAction already parses scratch|worktree|dir:<path>. Extend to accept worktree:<path> and set both workspace_kind=worktree and workspace_path.
  • For --branch, add an optional branch_name column to the kanban tasks table, or pass it through worker environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardtype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions