Problem
Magic Context currently has a positional two-pass reclaim path for tool results:
- an execute-class pass advances
tool_reclaim_watermark /
last_execute_ordinal to the current frontier;
- a later mutating execute or hard-fold pass selects every older tool arc at or
below that frontier;
- those arcs are dropped even when there was no explicit
ctx_reduce request,
no semantic supersession, and no emergency context pressure.
This makes tool output disappear as a side effect of an otherwise unrelated
context mutation. Age alone is not a reliable indication that a tool result is no
longer useful, so the behavior can remove evidence the model still needs and make
context changes difficult to attribute or debug.
The same policy exists in the OpenCode plugin, Pi plugin, and Rust module selector.
Expected behavior
Normal tool-result removal should have an attributable trigger:
- an explicit agent
ctx_reduce request;
- a configured
smart_drops supersession rule; or
- emergency context-pressure protection.
A previous execute watermark should not silently select a tool result for removal.
Proposed change
- Remove the age/watermark synthetic reclaim selector and watermark advancement
from OpenCode and Pi.
- Remove the equivalent selector from the Rust module.
- Keep explicit
ctx_reduce, smart_drops, Historian/Dreamer behavior, and
emergency cleanup unchanged.
- Retain the legacy storage fields as inert compatibility data so existing
databases and serialized state do not require a migration.
- Update documentation and generated schema/reference wording so
smart_drops
no longer implies general age-based cleanup.
Compatibility / trade-off
No schema migration is required. Context may retain more old tool output when
neither explicit reduction nor a supersession rule applies; emergency cleanup
remains the final pressure guard.
Problem
Magic Context currently has a positional two-pass reclaim path for tool results:
tool_reclaim_watermark/last_execute_ordinalto the current frontier;below that frontier;
ctx_reducerequest,no semantic supersession, and no emergency context pressure.
This makes tool output disappear as a side effect of an otherwise unrelated
context mutation. Age alone is not a reliable indication that a tool result is no
longer useful, so the behavior can remove evidence the model still needs and make
context changes difficult to attribute or debug.
The same policy exists in the OpenCode plugin, Pi plugin, and Rust module selector.
Expected behavior
Normal tool-result removal should have an attributable trigger:
ctx_reducerequest;smart_dropssupersession rule; orA previous execute watermark should not silently select a tool result for removal.
Proposed change
from OpenCode and Pi.
ctx_reduce,smart_drops, Historian/Dreamer behavior, andemergency cleanup unchanged.
databases and serialized state do not require a migration.
smart_dropsno longer implies general age-based cleanup.
Compatibility / trade-off
No schema migration is required. Context may retain more old tool output when
neither explicit reduction nor a supersession rule applies; emergency cleanup
remains the final pressure guard.