Skip to content

committed patch mode - #8

Merged
sdevare-nv merged 3 commits into
sdd/devfrom
sdd/committed-patch-mode
Aug 26, 2026
Merged

committed patch mode#8
sdevare-nv merged 3 commits into
sdd/devfrom
sdd/committed-patch-mode

Conversation

@sdevare-nv

Copy link
Copy Markdown
Owner

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

sdevare-nv and others added 2 commits August 2, 2026 19:04
Some SWE task families end their problem statement with an instruction to
work on a new branch and commit everything when done. The agent obeys,
leaving a clean working tree, so the existing `git diff` capture returns
nothing and the rollout is recorded as a 0-byte patch. What non-empty
patches do survive tend to be uncommitted build artifacts (build/CMakeFiles,
*.o, *.a, .ninja_log) rather than the solution.

Add a second capture mode, selected by --patch-mode (gym passes it through
the PATCH_MODE env var). `worktree` is the default and is the historical
behaviour moved verbatim out of cli.ts. `committed` diffs the pre-agent HEAD
against the most-advanced commit the agent left, searching HEAD *and* every
local branch so work still lands when the agent commits on a side branch and
checks main back out. Uncommitted leftovers are excluded and logged.

The result is still a plain baseline -> final-tree diff, so the eval side
(git reset --hard <base_commit> + git apply) is unchanged in either mode.

Also sets a repo-local git identity in committed mode when the image ships
none, so the agent's first commit can't die with "Author identity unknown".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
merge sdd/dev to compaction
@github-actions

Copy link
Copy Markdown

Hey! Your PR title committed patch mode doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No "Type of change" checkbox is checked. Please select at least one.
  • No issue referenced. Please add Closes #<number> linking to the relevant issue.
  • "How did you verify your code works?" section is empty. Please explain how you tested.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

…h-mode

Signed-off-by: Sugam Devare <sdevare@nvidia.com>
@sdevare-nv
sdevare-nv merged commit b1e2a57 into sdd/dev Aug 26, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant