Skip to content

fix: orch run from worktree creates separate vault, runs not visible from main repo #290

Description

@proboscis

Problem

When running orch run from a git worktree, the run is not visible when running orch ps from the main repository.

Root Cause

The config uses vault: . which is a relative path. When orch runs from a worktree:

  1. vault: . resolves to the worktree directory
  2. A new .orch/ directory is created in the worktree
  3. A separate daemon starts for the worktree's vault
  4. Runs are tracked in the worktree's vault, not the main repo's vault

Reproduction

# From main repo
cd ~/repos/orch
orch ps  # Shows runs

# From a worktree  
cd .git-worktrees/gh#285/...
orch run gh#287  # Creates run

# Back to main repo
cd ~/repos/orch
orch ps  # Run gh#287 NOT visible!

# From worktree
cd .git-worktrees/gh#285/...
orch ps  # Run gh#287 IS visible

Evidence

=== Worktree .orch ===
daemon.sock  daemon.pid  ...

=== Main repo .orch ===
daemon.sock  daemon.pid  ...  (different daemon!)

Suggested Fix

When in a git worktree, orch should detect this and use the main repo's vault instead of creating a new one. Options:

  1. Resolve vault: . to the git root (not worktree root)
  2. Follow .git file in worktrees to find the main repo
  3. Use absolute path in config instead of relative

Impact

  • Runs started from worktrees are invisible from main repo
  • Multiple daemons running for same logical project
  • Confusing UX when switching between main repo and worktrees

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions