refactor: move git functionality to package, improve git rollbacks#712
Merged
jonathanlab merged 6 commits intomainfrom Feb 3, 2026
Merged
refactor: move git functionality to package, improve git rollbacks#712jonathanlab merged 6 commits intomainfrom
jonathanlab merged 6 commits intomainfrom
Conversation
joshsny
approved these changes
Feb 3, 2026
4 tasks
- Resolved conflicts in git/service.ts (kept git package implementation) - Removed packages/agent/src/worktree-manager.ts (functionality moved to @twig/git) - Included PR #754 changes: symlink CLAUDE.local.md to worktrees
- Add @twig/git as workspace dependency in agent package.json - Pass logger from parent saga to GitApplyTreeSaga and GitCaptureTreeSaga - Fix CaptureTreeSaga to clean up archive on upload failure using try/finally - Update tests to not check nested saga step names (only check error messages)
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.
Context: https://posthog.slack.com/archives/C09G8Q32R6F/p1769699024978149
We need to move our git operations into a package so we can:
We are now not directly calling the
gitCLI anymore usingexecAsyncbut instead use https://github.com/steveukx/git-js/ for a typed wrapper around Git.I've also checked/adjusted every git saga to ensure they don't have destructive/unintended rollbacks, or were missing a rollback
This should make solving #599 easier along with #522 , #374 and #702