aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-18 12:45:05 +0100
committersalmonik <salmonik@tuta.io>2026-11-18 12:45:05 +0100
commit226c44dc770dd0ea42e322af4d0edd6c14ce14db (patch)
treee41318cd028770a1d16408712a5549ef59e36622 /docs
parent0.10.0: --json, /models /model /forget, git-repo gate for --yolo (diff)
downloadagent686-226c44dc770dd0ea42e322af4d0edd6c14ce14db.tar.gz
agent686-226c44dc770dd0ea42e322af4d0edd6c14ce14db.zip
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
Diffstat (limited to 'docs')
-rw-r--r--docs/adr/0003-compact-is-a-sanctioned-rewrite.md37
1 files changed, 37 insertions, 0 deletions
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 @@
1# 0003 — `/compact` is the single sanctioned rewrite of a transcript
2
3**Status:** accepted
4
5## Context
6
7ADR 0002 made sessions append-only and forbade rewriting history, because the
8provider's prompt cache depends on a byte-identical prefix and any edit to
9earlier messages invalidates it. The cost of that decision was a hard context
10ceiling: a long conversation could not be shortened, only abandoned.
11
12The default model accepts ~500k tokens, so the ceiling is rarely reached, but
13when it is, "start a new session" loses everything in the conversation.
14
15## Decision
16
17`/compact` is an explicit, user-initiated command that:
18
191. asks the model for a one-paragraph summary of the conversation (a single
20 non-streaming completion),
212. rewrites the session file to `header + system + one user message` carrying
22 that summary, under the same session id,
233. continues in place.
24
25It is the **only** code path that truncates a transcript, and it deliberately
26breaks the prompt cache — an accepted cost, because the user asked for it and it
27happens once, not on every step.
28
29## Consequences
30
31- A long session can now be continued instead of abandoned, at the price of the
32 detail the summary omits.
33- The cache is cold after `/compact`; the next turn re-bills the whole prefix.
34- There is no rollback: the pre-compact messages are gone. The summary is the
35 only record, so a bad summary loses real context.
36- ADR 0002 still governs everything else: no summarisation, truncation, or
37 sliding window happens automatically.