Skip to content

fix(roadmap): reset a head that the agent moved - #3883

Merged
dan-petty merged 4 commits into
mainfrom
fix/3575-head-moved-reset
Nov 7, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/3575-head-moved-reset

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The shell of the agent allows git, so an agent can commit during a step. A step makes the only commit, so the first exit check stopped the step with the class head_moved and discarded its work (#2636 lost 7,166,584 input tokens this way). The step now puts HEAD back to the expected head of its keeper with git reset --soft, which keeps the work in the checkout, prints one line, and lets the exit checks judge the work. It stops with head_moved only when the reset fails. The wip: commits of the step stay until the step folds them into its commit.

Closes #3575

Change: openspec/changes/archive/2026-11-06-3575-reset-a-moved-head/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 7, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results (kept out of the body).

fail-to-pass run (uv run devops ci fail-to-pass --base origin/main): 6 tests fail on base and pass on the branch. They are in tests/roadmap/test_roadmap_implement_step.py, tests/roadmap/test_roadmap_implement_step_failure_class.py and tests/roadmap/test_roadmap_implement_step_repair.py. The three files run 158 tests; 152 pass on base.

Full uv run devops ci on the branch: 20206 passed, 2 failed, 1 error. All 25 rows pass except test and coverage. The failures are the known host failures that fail on main too: tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run and tests/ai/test_tool_executor_contract.py (#3585). The test row took 18 minutes under a loaded host (the over-5-minutes row is #3593); the change adds no slow test.

Premise: see ## Feasibility in the archived proposal. Tests use real git in tmp_path. One test fakes the exit of git reset --soft at the process edge to show the stop with head_moved.

@dan-petty
dan-petty marked this pull request as ready for review November 7, 2026 04:20
@dan-petty
dan-petty merged commit 0ff477f into main Nov 7, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/3575-head-moved-reset branch November 7, 2026 04:20
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.77.0](v0.76.2...v0.77.0)
(2026-11-07)


### Features

* **ai:** web search falls back to DuckDuckGo
([#3900](#3900))
([61b5c43](61b5c43))
* **k8s:** add warnings and errors above logs, narrow both by pod
([#3886](#3886))
([6d105c2](6d105c2))
* **k8s:** Name one chat model for every slot of the Service
([#3891](#3891))
([4189c93](4189c93))
* **rag:** index managed repos and exclude private from search
([#3895](#3895))
([3cd4eba](3cd4eba)),
closes [#1389](#1389)


### Bug Fixes

* **roadmap:** name the reason of a failed intake write
([#3879](#3879))
([a341524](a341524))
* **roadmap:** reset a head that the agent moved
([#3883](#3883))
([0ff477f](0ff477f)),
closes [#3575](#3575)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): a step whose agent moved HEAD is reset, not stopped

1 participant