commit - be34cde492d09f4d170c455cbc9f45744a760542
commit + 323a47d9cab66665f0a5e7b0432a69d1c942642f
blob - 6448ded5200f6427efc50b02b0613c95dcbcee13
blob + dbad885fd0eda2385b60b61284eada022524fafb
--- .scratch/context-compaction/issues/03-auto-compaction-with-overflow-recovery.md
+++ .scratch/context-compaction/issues/03-auto-compaction-with-overflow-recovery.md
# Add automatic compaction with one-shot overflow recovery
-Status: needs-triage
+Status: ready-for-agent
Type: task
## What to build
## Triage decisions
-1. Pin the configuration names and whether model-specific `context_limit`
- remains an override for auto-compaction.
-2. Choose the durable suffix representation: stable Journal entry references
- or an explicit retained-message snapshot in the compact record.
-3. Pin provider-specific overflow codes/statuses from captured primary-source
- fixtures before implementing the typed classifier.
+1. Use `auto_compact yes|no`, `compact_reserve_tokens`, and
+ `compact_keep_tokens`. Automatic compaction defaults to enabled with 16,384
+ reserve tokens and 20,000 kept tokens. The existing effective-window rule
+ remains authoritative, so `context_limit` continues to override
+ provider-reported and compiled model windows.
+2. Store an explicit bounded retained-message snapshot in the same atomic
+ System-epoch record as the replacement summary. Stable Journal byte offsets
+ are rejected because legacy records, partial tails, and future encodings
+ would turn storage layout into replay semantics.
+3. Classify only OpenAI-compatible HTTP 400 or stream errors whose structured
+ `error.code` is exactly `context_length_exceeded`. Direct Anthropic and the
+ experimental Claude Subscription route have no unique structured overflow
+ discriminator and therefore retain terminal failure behavior. Never infer
+ overflow from HTTP status, `invalid_request_error`, 413 byte limits, or
+ English prose. The pinned evidence and near-miss matrix are in
+ `docs/research/provider-context-overflow-classification.md`.
## Comments
file tracking ticket 02 remains a blocker. Configuration names, durable suffix
representation, and pinned Provider overflow classifications still require
maintainer decisions before this high-risk Turn/Journal change is agent-ready.
+
+2026-07-17 implementation kickoff: the Owner authorized the complete four-item
+dependency chain. The three decisions above are now pinned; issue 02 remains
+the only implementation dependency.