diff options
| author | Adam Malczewski <[email protected]> | 2026-06-22 01:09:26 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-22 01:09:26 +0900 |
| commit | 5af664777bd64cddd168679d6369cd188212201a (patch) | |
| tree | 8e72022183b8d72eccdb568de5776d74cd91f1aa /packages/kernel/src/runtime | |
| parent | 28154825fb47248be21a0d64fc36492fb01c9a42 (diff) | |
| download | dispatch-5af664777bd64cddd168679d6369cd188212201a.tar.gz dispatch-5af664777bd64cddd168679d6369cd188212201a.zip | |
feat: non-destructive compaction — fork history to archive before replacing
Compaction now preserves the full pre-compaction history:
1. Forks the conversation to a new archive ID (complete copy: chunks,
metadata, cwd, reasoning-effort). Archive gets status=closed,
title='Archive: <original>', compactedFrom=<originalId>.
2. Replaces the original conversation's history with [system: summary]
+ recent N messages (same as before).
3. Sets compactedFrom=<archiveId> on the original conversation's metadata.
The original history is never destroyed. The archive is accessible via
GET /conversations/:id using the archive ID.
Wire/contract changes:
- ConversationMeta: add compactedFrom?: string
- CompactionResult: add archiveId: string
- ConversationCompactedMessage: add archiveId
- CompactResponse: add archiveId
Conversation store:
- forkHistory(sourceId, targetId): copies all chunks + metadata to a
new conversation ID
- setCompactedFrom(conversationId, archiveId): marks the conversation
Diffstat (limited to 'packages/kernel/src/runtime')
0 files changed, 0 insertions, 0 deletions
