Skip to content

fix: git-checkout — make branch optional to support creating branches from HEAD#109

Merged
huberp merged 1 commit into
mainfrom
copilot/fix-workflow-failure
Apr 25, 2026
Merged

fix: git-checkout — make branch optional to support creating branches from HEAD#109
huberp merged 1 commit into
mainfrom
copilot/fix-workflow-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

The git-checkout tool required branch in its schema, but the LLM naturally calls it as {"newBranch": "feature/..."} when creating a branch from the current HEAD. Schema validation rejected every attempt, the agent looped, and LangGraph hit its recursion limit (25), failing the oneshot CI job.

Changes

  • src/tools/git-checkout.tsbranch is now optional. Behaviour by case:
    • newBranch only → git checkout -b <newBranch> (from HEAD)
    • newBranch + branchgit checkout -b <newBranch> <branch> (original)
    • branch only → git checkout <branch> (original)
    • neither → explicit error returned
  • src/__tests__/git-tools.test.ts — added test for the HEAD-based branch creation path

@huberp huberp marked this pull request as ready for review April 25, 2026 12:40
@huberp huberp merged commit 45db337 into main Apr 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants