Skip to content

Worktree creation failure must never silently run the agent in the main checkout #511

Closed

Description

@currentbits

Source: research round 18, stolen from a Devin Desktop fix (changelog 2026-08-10): "Starting an agent in a new worktree that fails now surfaces the git error instead of quietly running in your workspace."

The failure mode this prevents is nasty: worktree creation fails (disk full, locked index, branch name collision, dirty submodule), the orchestrator falls back to the main checkout, and the agent now edits, builds, and commits directly on the user's working branch. Every isolation guarantee Solenta advertises is void and the user cannot tell from the UI.

Audit + guard for Solenta (electron/worktrees.js, electron/runner.js):

  • If a thread was configured to run in a worktree and worktree creation fails, the turn must not start. Surface the git stderr verbatim in the thread with a retry action.
  • No silent fallback path from "worktree" to "main checkout". If a fallback to main is ever offered, it is an explicit user choice with a scary confirmation, never a default.
  • Regression test: force git worktree add to fail (fake git on PATH, the pattern already used in electron/test/worktrees.test.js) and assert the runner records a setup error and zero agent processes spawn.

Related: #192 (pre-warmed worktree pool, where a warm-pool miss could be tempted to fall back), #396 (env contract during provisioning).

Activity

  1. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Round 22 corroboration from Anthropic: Claude Code just hardened worktree isolation along exactly this axis: it "now blocks not only file edits but also Bash commands and git redirects that reach the main checkout, in every session type and in the session's subagents." Their threat model confirms this issue's premise twice over: (1) the escape hatch is not the file tools, it is the shell (cd ../.. &&, git -C /main/checkout, redirects); (2) subagents must inherit the confinement, or the isolation is theater. When auditing Solenta's runner: check what working directory and env a spawned agent's Bash gets, whether git -C back to the main checkout is detectable, and whether the guard propagates to subagent spawns.

  2. added
    plan:doing
    and removed
    plan:todo
    on Aug 18, 2026
  3. added
    plan:done
    and removed
    plan:doing
    on Sep 8, 2026
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

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions