Problem
When thinktank apply hits a merge conflict, the error message is:
Failed to apply diff. There may be conflicts.
The worktree is preserved at: /tmp/thinktank-2-abc123
You can manually apply changes from there.
This leaves the user:
- Not knowing which files conflicted
- Not knowing how to proceed (should they
git merge? copy files? discard?)
- With a dangling worktree they have to clean up manually
Proposed improvement
After a failed git apply --3way, parse the conflict output and show:
✗ Apply failed: 2 files have conflicts
Conflicted files:
src/auth/middleware.ts
tests/auth.test.ts
Options:
1. Open worktree and resolve manually: /tmp/thinktank-2-abc123
2. Try a different agent: thinktank apply --agent 3
3. Discard this attempt: thinktank apply --cleanup
The worktree at /tmp/thinktank-2-abc123 is preserved until you resolve or discard.
Implementation notes
- Parse
git apply stderr for error: ... already exists in index and CONFLICT markers
--cleanup flag removes the preserved worktree without applying anything
- Consider adding
thinktank apply --open to open the worktree in the user's editor
Acceptance criteria
Problem
When
thinktank applyhits a merge conflict, the error message is:This leaves the user:
git merge? copy files? discard?)Proposed improvement
After a failed
git apply --3way, parse the conflict output and show:Implementation notes
git applystderr forerror: ... already exists in indexandCONFLICTmarkers--cleanupflag removes the preserved worktree without applying anythingthinktank apply --opento open the worktree in the user's editorAcceptance criteria
thinktank apply --cleanupremoves the preserved worktree and exits cleanlythinktank apply --agent Nworks as a retry with a different agent