Skip to content

polyresearch CLI commands fail when run from inside a worktree #174

Description

@alanzabihi

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwave-1Parallel batch 1: no dependencies

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions