Engineering

Context and History Are Not the Same Thing

Eric Brasher August 5, 2026 at 10:45 AM 5 min read

The most important decision in the compaction work was to stop treating every token problem as a history problem. The prompt being sent right now and the conversation stored for tomorrow have different lifetimes, costs, and recovery needs. FabrCore v1.7.1 gives each one its own layer.

Layer 1 Is a Projection

Context compaction operates on the request being assembled for the current model call. It can collapse or omit older tool results while leaving durable history untouched. On the next turn, FabrCore can build a fresh projection from the persisted source.

This is ideal for autonomous execution. One iteration may inspect a 40-page report, a package tree, and several API payloads. The next iteration usually needs conclusions and references, not every raw byte. Evicting that material from the active request controls cost without destroying the record.

Layer 2 Rewrites the Thread

History compaction is for conversations whose durable source has become too large. It summarizes older entries, preserves a configurable recent tail, and writes the consolidated history back to agent state. That reduces future activation and projection costs, but it is a lossy decision and therefore sits later in the ladder.

Because it changes persisted state, layer 2 needs concurrency control, stale-work recovery, and explicit observability. It also remains available when layer 1 cannot run, using the earlier 75% behavior as a fallback.

Two Numbers Unlock Layer 1

FabrCore must know both the provider's total context window and the output space reserved for the answer. Set ContextWindowTokens and MaxOutputTokens on the selected model configuration. If either is missing, layer 1 reports itself as unconfigured rather than guessing.

The legacy MidTurnCompactionEnabled setting is still accepted for configuration compatibility, but it is obsolete and ignored. The current control is ContextCompactionEnabled, with separate eviction and truncation thresholds.

Migration check

Do not copy an old 75% history threshold into the new ladder without reviewing the order. With layer 1 enabled, the default history rung moves to 87% so it remains behind truncation.