3 -Experimental goal: expose a `forget` tool that removes selected transcript spans
4 -from the **active LLM context window**.
4 +expose a `forget` tool that removes selected transcript spans from the **active
8 -- Pi session files are append-only. Entries cannot be modified or physically
9 - deleted through `SessionManager`.
9 +- Pi session files are append-only.
10 + Entries cannot be modified or physically deleted through `SessionManager`.
10 11 - Active context can still be changed safely by adding a compaction entry.
11 12 `appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromHook)`
12 13 makes `buildSessionContext()` emit the summary, then branch messages from
13 14 `firstKeptEntryId` onward.
14 -- Recent tail deletion is already covered by Pi tree navigation/forking. It is
15 - out of scope for Forget.
16 -- Middle deletion is not supported without replaying or filtering the transcript.
15 +- Recent tail deletion is already covered by Pi tree navigation/forking.
16 + It is out of scope for Forget.
17 +- Middle deletion is not supported without replaying or filtering the
17 19 Replay breaks IDs/tool-call adjacency; per-turn filtering is fragile and not a
18 20 persistent session edit.
23 - - `mode="inspect"`: list active branch entries with id, role/type, rough token
24 - estimate, and no content preview by default. Preview is opt-in only because
25 - inspect output itself becomes newer context and can otherwise re-leak text
26 - the next `before` compaction is meant to hide.
27 - - `mode="before"`: append a compaction entry that replaces all active context
28 - before `entry_id` with a short tombstone summary.
29 -- Per-prompt system reminder: short turn-local line tells the agent to consider
30 - Forget when the user starts a new task/objective and skip same-task follow-ups.
27 + list active branch entries with id, role/type, rough token estimate, and no
28 + content preview by default.
29 + Preview is opt-in only because inspect output itself becomes newer context
30 + and can otherwise re-leak text the next `before` compaction is meant to
33 + append a compaction entry that replaces all active context before `entry_id`
34 + with a short tombstone summary.
35 +- Per-prompt system reminder:
36 + short turn-local line tells the agent to consider Forget when the user starts
37 + a new task/objective and skip same-task follow-ups.
32 39 - target must exist on active branch.
33 - - target must be the latest user message, marked `current_user=yes` by inspect.
40 + - target must be the latest user message, marked `current_user=yes` by
34 42 - target must not be a `toolResult` or stale earlier user message.
35 - - dry-run preview available with `dry_run: true`.
43 + - dry-run preview available with `dry_run:
36 45 - no physical deletion claim; JSONL keeps recoverable history.
37 46 - not a secret-redaction guarantee; newer/current messages and model thinking
38 47 can still contain sensitive strings.
42 -- Unit: branch formatting, target validation, forget summary/details.
43 -- Harness: extension loads, tool registers, injects short per-prompt reminder,
44 - `inspect` output works, `before` creates compaction with expected
45 - `firstKeptEntryId`, context drops old text, `range` refuses.
46 -- Real MiniMax: optional `FORGET_REAL=1`; runs isolated SDK session with only
47 - Forget loaded, calls real model, applies forget, verifies compaction is active.
48 -- Real task-switch probes: baseline prompt had 0 compactions; stronger
49 - `MUST` + `current_user=yes` prompt caused MiniMax to forget at task switches
50 - while still answering simple tasks.
52 + branch formatting, target validation, forget summary/details.
54 + extension loads, tool registers, injects short per-prompt reminder, `inspect`
55 + output works, `before` creates compaction with expected `firstKeptEntryId`,
56 + context drops old text, `range` refuses.
58 + optional `FORGET_REAL=1`; runs isolated SDK session with only Forget loaded,
59 + calls real model, applies forget, verifies compaction is active.
60 +- Real task-switch probes:
61 + baseline prompt had 0 compactions; stronger `MUST` + `current_user=yes` prompt
62 + caused MiniMax to forget at task switches while still answering simple tasks.