Skip to content

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

Closed
antauth-alfonso[bot] wants to merge 2 commits into
mainfrom
fix/thread-tail-restart
Closed

antauth-alfonso[bot] wants to merge 2 commits into
mainfrom
fix/thread-tail-restart

Conversation

@antauth-alfonso

@antauth-alfonso antauth-alfonso Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

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.

Written for commit 0669bfa. Summary will update on new commits.

View guided diff Turn on auto-fix

@antauth-alfonso

Copy link
Copy Markdown
Author

Squash-merged to main as 4442c37.

@antauth-alfonso antauth-alfonso Bot closed this Nov 22, 2026
@ualtinok
ualtinok deleted the fix/thread-tail-restart branch November 22, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant