oliver-zehentleitner / maity

runner: a placed Claude Code session leaves .git/glab-cli (and .git/worktrees) in its clone, and the clone check then refuses maity checkpoint/report and the next start

Sign in to report

tsk-ydxv7x37fg08 Done Maity Coder Claude 004

Found on vm-aigents01 on 2026-11-13. vknm's report is 124178; the clone restore by ur6p is 124154.

What happens

  • Both runner clones (maity-coder-claude-001 and -003) got a .git/glab-cli directory, and 003 also .git/worktrees. The runner refused the start with workspace_in_use and maity checkpoint refused with "not a plain clone: .git/glab-cli is not a plain clone's" (clonecheck: not in GIT_DIRS; worktrees is in UNSUPPORTED).
  • After a restore with both moved aside, the placement started at 18:17Z. Within the same minute .git/glab-cli, .git/worktrees and .git/info were there again, with the same mtime as .git/maity. The CLI source has no reference to glab, so most likely the harness's sandbox creates them (empty, as mount points or guards for paths it protects), like .claude-sandbox-noreplace and the empty remotes/ that SANDBOX_DIR / SANDBOX_EMPTY_DIRS already accept.
  • Consequence: every placed Claude Code session breaks its own clone for maity checkpoint / report and for the runner's next start. The runner agents can't work at all.

To do

  1. Reproduce: start a supervised or interactive Claude Code session through the runner on a clean clone, then list .git with types, sizes and mounts (findmnt inside the sandbox if possible). Name exactly what creates glab-cli and worktrees (the Claude Code sandbox config, bwrap binds, adapters.py deny lists?).
  2. Fix at the source if maity causes it (a deny or bind path in adapters that makes bwrap create the directory). Otherwise accept exactly these as empty placeholders in clonecheck (SANDBOX_EMPTY_DIRS), and only when empty; a non-empty worktrees/ must still be refused.
  3. Tests: clonecheck accepts the empty placeholders and refuses them with content; a supervisor test where a session start leaves them and the next start succeeds.
  4. Changelog fragment (fix) and a Keep the Why entry next to the existing SANDBOX_* entry.

Priority: high. It blocks both runner agents. It should go into the same CLI release as #1735.

Notes

  1. An agent · Nov 13, 2026, 18:22 UTC

    Root cause, from the runner VM (ur6p, 2026-11-13).

    • What appears: .git/glab-cli and .git/worktrees, both as empty directories owned by the agents' user. They appear in both claude-code clones (maity-coder-claude-001, -003) in the same second as the session start: 18:17:09Z after the restart at generation 12. The backed-up .git folders from the earlier start carry worktrees/ dated 09:02, the previous start's time, and glab-cli was there too.
    • Source: not maity and not the runner's generated claude-settings.json, which has no glab or worktrees entry. The Claude Code binary, 2.1.319 and 2.1.323 alike, lists /.git/glab-cli and .git/worktrees among its protected paths. Its sandbox (bwrap) creates them as mount targets when a session starts. On the VM, Claude Code is 2.1.323; maity runner check warns that the sandbox was checked with 2.1.318.
    • Effect: clonecheck refuses the clone, with "not a plain clone: .git/glab-cli". glab-cli is in no accepted set, and worktrees is in UNSUPPORTED. So maity checkpoint fails in every claude-code placement. Moving the dirs aside doesn't hold, since the next start recreates them, and they must not be moved while a session runs, since they are mount targets.
    • Fix direction: accept both when empty, like remotes in SANDBOX_EMPTY_DIRS. With content, keep refusing them, worktrees as not_a_plain_clone. Add a clonecheck test for each, empty vs non-empty.