Skip to content

cleanup_worktrees のテストの git wrapper が,Xcode の git shim を掴むと無限ループする #307

Closed

Description

@furedea-agent

cleanup のテストは shutil.which("git") で見つけた git を呼ぶ wrapper を tmp_path/bin/git に置く.PATH で /usr/bin が nix の git より前にあると,/usr/bin/git(Xcode の shim)を掴む.shim は PATH から git を探し直して wrapper を再び呼ぶため,無限ループになり 30 秒で時間切れになる(または exit 255).エージェントのセッションでは毎回失敗し,Stop hook の検証も時間切れになる.

変更前 変更後
wrapper が呼ぶ git shutil.which("git") の結果(shim のことがある) shim ではない本物の git(例:git --exec-path から割り出す,または /usr/bin の shim を除いて探す)
/usr/bin が nix の git より前にある PATH 約 15 件が失敗 全件 pass

受け入れ条件

  • /usr/bin を nix の git より前に置いた PATH で,cleanup のテスト(test_cleanup_worktrees*.py)が全件通る
  • nix の git が先の PATH でも通る
  • CI でも通る
  • 同じ wrapper のやり方をしているほかのテストがあれば,同じように直す
再現

uv run --frozen pytest -q tests/agents/hooks/test_cleanup_worktrees.py tests/agents/hooks/test_cleanup_worktrees_isolation.py tests/agents/hooks/test_cleanup_worktrees_trust.py を Claude のセッションで実行すると約 15 件が失敗する.PATH="/etc/profiles/per-user/kaito/bin:$PATH" を付けると 101 件すべて通る.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions