fix: compact command after revert now properly cleans up revert state (#6235)

This commit is contained in:
Christopher Ochsenreither
2025-12-26 21:57:59 -07:00
committed by GitHub
parent 1bcc72c477
commit bfb9787361
2 changed files with 287 additions and 0 deletions

View File

@@ -1084,6 +1084,8 @@ export namespace Server {
async (c) => {
const sessionID = c.req.valid("param").sessionID
const body = c.req.valid("json")
const session = await Session.get(sessionID)
await SessionRevert.cleanup(session)
const msgs = await Session.messages({ sessionID })
let currentAgent = await Agent.defaultAgent()
for (let i = msgs.length - 1; i >= 0; i--) {