diff options
| author | Adam Malczewski <[email protected]> | 2026-06-22 01:31:29 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-22 01:31:29 +0900 |
| commit | 2772e0723cfc7898443320515e165a625de1db46 (patch) | |
| tree | c65e8a7c1a9ffb1ca6b44147cd3eb8629aa47830 /.dispatch/wire.reference.md | |
| parent | 54e88b71efd9a6fd9d880b6e90d844a875808662 (diff) | |
| download | dispatch-web-2772e0723cfc7898443320515e165a625de1db46.tar.gz dispatch-web-2772e0723cfc7898443320515e165a625de1db46.zip | |
feat(compaction): conversation compacting + auto-compact threshold
Consume the compaction handoff ([email protected], [email protected]).
Re-pinned file: deps + re-mirrored .dispatch/*.reference.md.
- New 'Compaction' sidebar view (CompactionView.svelte):
- 'Compact now' button → POST /conversations/:id/compact (loading indicator
+ result: 'N messages summarized, M kept')
- Auto-compact threshold number input → GET/PUT
/conversations/:id/compact-threshold (0 = disabled, default 350000)
- Re-mounts per conversation via {#key}
- App store: compactNow() + compactThreshold reactive state +
setCompactThreshold(), seeded on focus change (like reasoning-effort + cwd)
- conversation.compacted WS handler: reloads the SAME conversation's history
(ID unchanged — old history forked to an archive, not a tab switch)
- WS adapter parses newConversationId field on ConversationCompactedMessage
- conformance guards + tests cover the new type
686 tests green.
Diffstat (limited to '.dispatch/wire.reference.md')
| -rw-r--r-- | .dispatch/wire.reference.md | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/.dispatch/wire.reference.md b/.dispatch/wire.reference.md index ead4d9c..44b0fe7 100644 --- a/.dispatch/wire.reference.md +++ b/.dispatch/wire.reference.md @@ -4,9 +4,14 @@ > types WITHOUT following the `file:` dep symlink out of this repo (which hangs on a permission > prompt). Your CODE still imports `@dispatch/wire` normally — this file is for READING only. > -> **Orchestrator:** SNAPSHOT of `[email protected]` (conversation lifecycle status). Regenerate +> **Orchestrator:** SNAPSHOT of `[email protected]` (compaction). Regenerate > whenever `@dispatch/wire` changes. > +> **2026-06-22 delta (compaction handoff — package bumped `0.10.0` → `0.11.0`, ADDITIVE):** +> adds `CompactionResult` — the result of a compaction operation (`summary`, `messagesSummarized`, +> `messagesKept`). The summary text is the model's output; the FE doesn't render it directly (it +> becomes the conversation's first system message after compaction). +> > **2026-06-22 delta (conversation lifecycle handoff — package bumped `0.9.0` → `0.10.0`, ADDITIVE):** > adds `ConversationStatus` (`"active" | "idle" | "closed"`) — the per-conversation lifecycle > status. `ConversationMeta` gains a `status` field. `active` = a turn is generating; `idle` = @@ -612,5 +617,21 @@ export interface ConversationMeta { readonly lastActivityAt: number; readonly title: string; readonly status: ConversationStatus; + /** Points to the archive conversation with full pre-compaction history. */ + readonly compactedFrom?: string; +} + +// ─── Compaction ────────────────────────────────────────────────────────────── + +/** + * Result of a compaction operation. `summary` is the text the model produced; + * `messagesKept` is how many recent messages were retained after the summary; + * `messagesSummarized` is how many old messages were replaced by the summary. + */ +export interface CompactionResult { + readonly summary: string; + readonly newConversationId: string; + readonly messagesSummarized: number; + readonly messagesKept: number; } ``` |
