Summary
When creating a new worktree through the Orca app, the setup-runner.sh it generates is built from the orca.yaml of the primary checkout, not the orca.yaml at the tip of the target worktree's branch. If your primary checkout is on an older branch that predates an orca.yaml change, every new worktree you create — even off main — runs the stale setup script.
Repro
- On branch
main (say at commit A), add a line to orca.yaml scripts.setup: echo "new line". Merge to main.
- Switch your primary checkout to any branch that predates that commit:
cd ~/projects/orca && git checkout some-old-feature-branch.
- From the Orca app, create a new worktree off
main.
- Expected: the new worktree's
orca.yaml has the new line, and .git/worktrees/<name>/orca/setup-runner.sh includes it.
- Actual: the new worktree's
orca.yaml has the new line (git is correct), but setup-runner.sh contains only the pre-change version — because it was generated from the primary checkout's current HEAD yaml.
Impact
- Any orca.yaml change rolled out via a PR is invisible to teammates until their primary checkout is on a branch that contains the change.
- Silent failure mode: yaml looks right on disk, setup script disagrees, no warning logged.
- Surfaces in practice when a team uses orca.yaml for environment bootstrap (e.g. populating secrets, agent skills, etc.) — teammates think their setup is broken when actually the runner is stale.
Expected behavior
setup-runner.sh should be generated from the target worktree's orca.yaml (the file that git checked out into the new worktree), not the primary checkout's HEAD.
Relevant code
src/main/hooks.ts — the orca.yaml parser and createWorktreeRunnerScript. The loadHooks(repo.path) call in getSetup/getArchive reads from the repo's primary path rather than the worktree path.
Workaround
Keep primary checkout on main (or whatever branch has the canonical orca.yaml) when creating new worktrees. Brittle — easy to forget when in the middle of a feature branch.
Made with Orca 🐋
Summary
When creating a new worktree through the Orca app, the
setup-runner.shit generates is built from theorca.yamlof the primary checkout, not theorca.yamlat the tip of the target worktree's branch. If your primary checkout is on an older branch that predates anorca.yamlchange, every new worktree you create — even offmain— runs the stale setup script.Repro
main(say at commit A), add a line toorca.yaml scripts.setup:echo "new line". Merge tomain.cd ~/projects/orca && git checkout some-old-feature-branch.main.orca.yamlhas the new line, and.git/worktrees/<name>/orca/setup-runner.shincludes it.orca.yamlhas the new line (git is correct), butsetup-runner.shcontains only the pre-change version — because it was generated from the primary checkout's current HEAD yaml.Impact
Expected behavior
setup-runner.shshould be generated from the target worktree'sorca.yaml(the file that git checked out into the new worktree), not the primary checkout's HEAD.Relevant code
src/main/hooks.ts— theorca.yamlparser andcreateWorktreeRunnerScript. TheloadHooks(repo.path)call ingetSetup/getArchivereads from the repo's primary path rather than the worktree path.Workaround
Keep primary checkout on
main(or whatever branch has the canonicalorca.yaml) when creating new worktrees. Brittle — easy to forget when in the middle of a feature branch.Made with Orca 🐋