fix: sidebar updates for /undo and compacting#5765
fix: sidebar updates for /undo and compacting#5765flatsponge wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
The compaction seems to work nicely, cool! The /undo needs more work:
|
|
i updated it so now the current diff is gotten via Session.diff(input.sessionID) so now: hopefully this works as expected.
|
|
Thanks for iterating on this! For some reason the 2nd approach doesn't work for me either, now the /undo commands don't have any effect on the Modified files at all. I send a user request, get 2 tool calls + assistant response, then another user request followed by 1 tool call + assistant response. The main view's "message(s) reverted" conversation bubbles properly show the "reverse" line changes (-2 for the first /undo, -4 for the second /undo), but perhaps that information is taken from elsewhere. |
|
Sorry for the delay in getting back to you. I was on holiday vacation. I am reusing the sidebar’s session_diff logic instead of duplicating it, and it should be working correctly now. Thanks for the patience! ps: for afa9319 github auto corrected the commit message but the actual message should just be "refactor for /undo" should i change it or is it fine like how it is? Thanks for the patience!
|
|
I'm not sure if I'm doing something wrong but for some reason this still doesn't work in my builds when testing /undo and /redo 🙁 |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
opencodefix.mp4I reverted and implemented a more stable fix + added a test file to verify the changes. |
|
I just did a quick test and both the "Context" and "Modified Files" in the sidebar now update properly across undos, redos and compactions. The speed of the actions is the same as in dev branch. Thank you for the improvement 👍 |
|
Closes
#5760 #4548
two very similar issues, so i batch fixed them. let me know if I should split it instead.
Issue:
compacting would not update the sidebar immediately after successful compaction and /undo does also not update Modified Files.
Cause:
Issue 1:
The /compact command triggers session.compacted event but session.compacted was NOT handled in
sync.tsx so the sidebar never updated
Issue 2:
/undo Command does not emit a session.diff event.
Only session.updated is published via Session.update causing the sidebar's Modified Files to never get updated.
Fix:
Issue 1:
Add handler for session.compacted
Issue 2:
After /revert emit a session.diff event with an empty diff array to clear the Modified Files list in the sidebar