Skip to content

RunResult.commits includes host commits when the branch moves during a merge-to-head run #1362

Open

Description

@mattpocock

Found by the weekly verify on 2026-11-01, on main@0460513 (reverify-branch-strategies). The code is the same at 15e2c34.

What happens

With the merge-to-head strategy, if the host branch gains commits while the run is in flight, RunResult.commits lists those host commits and the merge commit, not only the agent's commits. Commits are collected as baseHead..HEAD after the merge (src/SandboxLifecycle.ts:543-544), but src/run.ts:462 documents the field as the agent's commits.

Repro

Start run() with merge-to-head and an agent that commits once. While it runs, commit to the host branch. Then inspect result.commits.

Acceptance

  • commits contains only commits the agent made, whatever happens to the host branch during the run.
  • A test moves the host branch mid-run.

This issue was AI-generated (Claude Code) on behalf of @mattpocock.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions