stablyai/orca · error

Git merge-tree --write-tree is unavailable on this execution

Error message

Git merge-tree --write-tree is unavailable on this execution host.

What it means

Thrown as the final fallback of the merge-tree capability chain in loadConflictingFiles. The chain first tries `merge-tree --write-tree` (Git 2.38+), then the legacy merge-base form, then this terminal branch. Reaching it means the execution host's git is older than 2.38 AND the legacy form was also rejected (unsupported). Failing closed here is deliberate — the capability cache records the rejection so the same unsupported command is not respawned on every refresh.

Source

Thrown at src/main/github/conflict-summary.ts:277

                if (isUnsupportedMergeTreeWriteTreeError(error)) {
                  throw error
                }
                // Why: `git merge-tree --write-tree` exits 1 for conflicts but still
                // writes the useful file list; only option rejection reaches fallback.
                const stdoutFromError = getGitErrorOutput(error, 'stdout')
                if (stdoutFromError) {
                  return parseMergeTreeNameOnlyOutput(stdoutFromError)
                }
                throw error
              }
            },
            () => loadConflictingFilesWithLegacyMergeTree(repoPath, legacyArgs, localGitOptions),
            isUnsupportedMergeTreeMergeBaseError
          ),
        async () => {
          // Why: Git before 2.38 cannot derive a reliable real-merge conflict list;
          // fail closed without respawning the same rejected command every refresh.
          throw new Error('Git merge-tree --write-tree is unavailable on this execution host.')
        },
        isUnsupportedMergeTreeWriteTreeError
      )
  )
}

async function loadConflictingFilesWithLegacyMergeTree(
  repoPath: string,
  legacyArgs: string[],
  localGitOptions: LocalGitExecOptions
): Promise<string[]> {
  try {
    const result = await gitExecFileAsync(legacyArgs, {
      cwd: repoPath,
      ...(localGitOptions.wslDistro ? { wslDistro: localGitOptions.wslDistro } : {})
    })
    return parseMergeTreeNameOnlyOutput(result.stdout)
  } catch (fallbackError) {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. On the failing host, run `git --version` and `git merge-tree --write-tree 2>&1` to confirm the version gap.
  2. Upgrade git to 2.38 or newer on that host (the project's merge-tree floor).
  3. If upgrade is impossible, conflict-file listing for real merges will remain unavailable on that host — fall back to viewing conflicts via `git status` in a terminal.
  4. Reconnect after upgrading so the capability cache re-probes.
Defensive patterns

Strategy: validation

Validate before calling

import { execFileSync } from 'node:child_process'
function gitSupportsWriteTree(gitPath = 'git'): boolean {
  try {
    const out = execFileSync(gitPath, ['merge-tree', '--help'], { stdio: ['ignore', 'ignore', 'pipe'] }).toString()
    return /--write-tree/.test(out)
  } catch {
    return false
  }
}

Try / catch

try {
  const conflicts = await loadConflictingFiles(repoPath, baseOid, localGitOptions)
} catch (err) {
  if (/merge-tree --write-tree is unavailable/.test((err as Error).message)) {
    showLegacyConflictListFallback(repoPath) // instruct user to use `git status`
    return []
  }
  throw err
}

Prevention

When it happens

Trigger: SSH host or WSL distro running git < 2.38 where the legacy merge-tree fallback is also rejected; a minimal git build compiled without merge-tree support; a bundled git that was downgraded; the host's git is a wrapper script that rejects merge-tree.

Common situations: Older Ubuntu/Debian LTS with git 2.25-2.37; enterprise-managed git that strips subcommands; an SSH appliance with a pinned old git; WSL distro not updated.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/bd54d104be48ebc5. Report an issue: GitHub.