docs: update BRANCH LOCK hint to include HEAD -- path form [doc-updater] - #2258
Merged
Conversation
Contributor
There was a problem hiding this comment.
No agent-mode design concerns. This is a one-line documentation update that improves the accuracy of an existing agent hint, helping the agent discover useful command forms (HEAD -- <path>, <sha> -- <path>) that the gateway already permits. That's orientation, not constraint.
— Authored by egg
Contributor
There was a problem hiding this comment.
Approve.
Verified the change is accurate against the gateway implementation:
gateway/git_client.py:1816-1872(is_branch_switch) explicitly returnsFalsewhenever--is present, regardless of any tree-ish before it. The docstring lists the same three examples the updated hint mentions:git checkout -- file.txt,git checkout HEAD -- file,git checkout main -- file.- PR #2252 (the cited triggering fix) is merged on
main, so the behavior is in production. - The new hint enumerates
HEAD --,HEAD~1 --, and bare--, which is the most useful subset for agents recovering from a wrong-branch commit (the surrounding "Wrong branch fix" line) and for restoring tracked files mid-pipeline.
No issues — wording is accurate, scope is minimal, and the change is self-contained to sandbox/agent-config/rules/mission.md.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
egg review completed. View run logs 1 previous review(s) hidden. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs: Update BRANCH LOCK agent hint for
git checkout HEAD -- <file>Update
sandbox/agent-config/rules/mission.mdto reflect the fix from#2252, which corrected the gateway's
is_branch_switchheuristic toallow
git checkout [<tree-ish>] -- <path>(any form with--) as afile restore rather than a branch switch.
The old hint only mentioned
git checkout -- <file>, implying thatgit checkout HEAD -- <file>and similar commit-ish forms were notsupported in pipeline sessions. They are now correctly allowed. The
updated hint shows all three forms so agents discover the most useful
one (HEAD or a SHA) rather than only the bare form.
Triggered by: 2fa7dc6 (Fix #2247: allow
git checkout HEAD -- <path>in pipeline sessions (#2252))Test Plan
Authored-by: egg