Context
Branch: hybrid-agent-cli
Wave: 1 (critical, blocks contribute phase)
Found by: polytest run 20260423-133619, hit on 2 repos
Bug
polyresearch attempt and other CLI commands fail when the current working directory is a thesis worktree (.worktrees/<thesis>/) instead of the repo root. The CLI cannot locate the polyresearch configuration or protocol state from within the worktree.
The contribute workflow prompt tells the agent to cd into the worktree to run the experiment, then call polyresearch attempt from there. But the CLI expects to be run from the repo root.
Repos affected
- litellm — CLI commands failed from worktree, agent fell back to
gh directly
- pydantic —
polyresearch attempt failed when run from worktree
Evidence (pydantic)
polyresearch attempt fails when run from worktree
Phase: Contribute
The agent cd'd into .worktrees/1-..., ran the experiment, tried to call polyresearch attempt, and got an error about not finding the repo root.
Evidence (litellm)
polyresearch CLI commands fail when run from a worktree
Phase: Contribute
Severity: Critical
The agent gave up on CLI commands entirely and fell back to gh pr create after the CLI failed from the worktree path.
Possible fixes
- The CLI should walk up the directory tree to find the repo root, including following the
.git file in worktrees that points to the main repo's .git directory
- Or: the contribute prompt should instruct the agent to
cd back to the repo root before running polyresearch commands, passing the worktree path as an argument
Context
Branch:
hybrid-agent-cliWave: 1 (critical, blocks contribute phase)
Found by: polytest run
20260423-133619, hit on 2 reposBug
polyresearch attemptand other CLI commands fail when the current working directory is a thesis worktree (.worktrees/<thesis>/) instead of the repo root. The CLI cannot locate the polyresearch configuration or protocol state from within the worktree.The contribute workflow prompt tells the agent to
cdinto the worktree to run the experiment, then callpolyresearch attemptfrom there. But the CLI expects to be run from the repo root.Repos affected
ghdirectlypolyresearch attemptfailed when run from worktreeEvidence (pydantic)
The agent cd'd into
.worktrees/1-..., ran the experiment, tried to callpolyresearch attempt, and got an error about not finding the repo root.Evidence (litellm)
The agent gave up on CLI commands entirely and fell back to
gh pr createafter the CLI failed from the worktree path.Possible fixes
.gitfile in worktrees that points to the main repo's.gitdirectorycdback to the repo root before runningpolyresearchcommands, passing the worktree path as an argument