Skip to content

feat(chat): add conversation fork and revert with git patch support#25

Open
BowgartField wants to merge 1 commit intocoollabsio:mainfrom
BowgartField:feat/conversation-fork-and-revert-clean
Open

feat(chat): add conversation fork and revert with git patch support#25
BowgartField wants to merge 1 commit intocoollabsio:mainfrom
BowgartField:feat/conversation-fork-and-revert-clean

Conversation

@BowgartField
Copy link
Copy Markdown
Contributor

Summary

  • Add fork button on assistant messages to create new worktree with conversation history up to that point
  • Add revert button to undo messages and code changes using git patches (git apply -R)
  • Show action bar with timestamp, copy, fork, and revert buttons on assistant messages

Implementation

  • Capture git diff at end of each assistant run and store in run metadata
  • Apply reverse patches when reverting to restore code state
  • Show revert button only on messages with code modifications (Edit/Write/NotebookEdit)
  • Hide revert button on the last message (nothing to revert after it)

Test plan

  • Fork a conversation from an assistant message → new worktree created with history
  • Revert to a message with code changes → messages removed and code reverted
  • Verify revert button only appears on messages with Edit/Write/NotebookEdit tools
  • Verify revert button hidden on last message

- Add fork button on assistant messages to create new worktree with conversation history
- Add revert button to undo messages and code changes using git patches
- Capture git diff at end of each assistant run for revert functionality
- Apply reverse patches (git apply -R) when reverting to restore code state
- Show revert button only on messages with code modifications (Edit/Write/NotebookEdit)
- Hide revert button on the last message
- Add action bar with timestamp, copy, fork, and revert buttons on assistant messages
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