From 226c44dc770dd0ea42e322af4d0edd6c14ce14db Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 18 Nov 2026 12:45:05 +0100 Subject: 0.11.0: /undo via git checkpoints, /compact, provider presets, leniency, system CA - /undo resets to a git checkpoint taken before each turn - /compact summarises and rewrites the transcript (ADR 0003, the one sanctioned rewrite) - --provider presets for six OpenAI-compatible gateways, local ones lenient by default - --lenient and --system-ca - proxies already honoured via ureq; documented --- docs/adr/0003-compact-is-a-sanctioned-rewrite.md | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/adr/0003-compact-is-a-sanctioned-rewrite.md (limited to 'docs/adr') diff --git a/docs/adr/0003-compact-is-a-sanctioned-rewrite.md b/docs/adr/0003-compact-is-a-sanctioned-rewrite.md new file mode 100644 index 0000000..19a42dc --- /dev/null +++ b/docs/adr/0003-compact-is-a-sanctioned-rewrite.md @@ -0,0 +1,37 @@ +# 0003 — `/compact` is the single sanctioned rewrite of a transcript + +**Status:** accepted + +## Context + +ADR 0002 made sessions append-only and forbade rewriting history, because the +provider's prompt cache depends on a byte-identical prefix and any edit to +earlier messages invalidates it. The cost of that decision was a hard context +ceiling: a long conversation could not be shortened, only abandoned. + +The default model accepts ~500k tokens, so the ceiling is rarely reached, but +when it is, "start a new session" loses everything in the conversation. + +## Decision + +`/compact` is an explicit, user-initiated command that: + +1. asks the model for a one-paragraph summary of the conversation (a single + non-streaming completion), +2. rewrites the session file to `header + system + one user message` carrying + that summary, under the same session id, +3. continues in place. + +It is the **only** code path that truncates a transcript, and it deliberately +breaks the prompt cache — an accepted cost, because the user asked for it and it +happens once, not on every step. + +## Consequences + +- A long session can now be continued instead of abandoned, at the price of the + detail the summary omits. +- The cache is cold after `/compact`; the next turn re-bills the whole prefix. +- There is no rollback: the pre-compact messages are gone. The summary is the + only record, so a bad summary loses real context. +- ADR 0002 still governs everything else: no summarisation, truncation, or + sliding window happens automatically. -- cgit v1.2.3