Record each chat turn's workspace changes for every harness
Snapshot the chat directory with internal/filediff when a turn starts and compare it when the turn ends; store changed turns (newest 100 per chat), push chat_turn_diffs summaries, attach them to chat_messages replies and serve one turn's patches through chat_turn_diff.
This commit is contained in:
@@ -28,6 +28,9 @@ func handleChatMessages(ctx context.Context, request protocol.Message, broker ch
|
||||
page.Messages = hub.reconcileHistory(query.SessionID, page.Messages)
|
||||
response.ChatMessages = page.Messages // legacy peers keep working.
|
||||
response.ChatHistory = &page
|
||||
// The session's recorded per-turn changes ride with its history, so the
|
||||
// transcript's change chips survive a reload and a server restart.
|
||||
response.ChatTurnDiffList = hub.turnDiffList(ctx, query.SessionID)
|
||||
_ = write(response)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user