Persist the full-after-thread cache boundary across host restarts (OpenCode 2, Pi)

Draft
AN
16h ago
+547-36

After a server replacement the first full request lost its tail marker (no_anchor) and rewrote everything after message 1 (~330k tokens per head per cut). The marker record (hashes, positions, lifetimes only) is now persisted per session, owner-only, and reused under the existing checks.


Summary by cubic

Persists the full-after-thread cache boundary per session so the first full request after a host restart reuses the previous full request's prefix instead of rewriting everything after message 1 (~330k tokens per head per cut). Applies to both OpenCode 2 and Pi.

  • Stored records contain only hashes, positions, and lifetimes in owner-only files; no message text or credentials are written.
  • A persisted tail is reused only when it came from an accepted continuation and passes the existing identity, prefix, and lifetime checks.
  • Pi now keeps the tail when a session closes and removes it only when the session is deleted.