GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(capture): preserve pending evidence across session deletion by Phototonic · Pull Request #479 · tickernelz/opencode-mem

Conversation

@Phototonic

@Phototonic Phototonic commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Addresses #476.

Delayed auto-capture depended on a live transcript, so deleting a session could lose observed work before capture ran. This change persists bounded final assistant text and terminal tool outcomes from delivered V1/V2 events, then summarizes ready evidence without fetching a deleted host session.

  • Preserve prompt association: V1 binds assistant parent IDs; V2 freezes the delivered inbox input at step start so a later queued prompt cannot steal earlier results. Unknown/private inputs fail closed. Only narrowly recognized evidence events can use existing pending project ownership after host lookup fails.
  • Add a pending-evidence table, idle/deleted readiness checkpoints, same-project startup replay, claim cleanup, and disposal draining. Older prompts without evidence cannot block later recoverable prompts, and a missing host lookup is not repeated throughout the batch.
  • Redact private tags before storage, including across final text parts in one assistant message. Exclude reasoning, raw deltas, attachments, provider metadata, and tool arguments. Limits are 16 KiB per part, 16 parts per prompt, 256 parts globally (4 MiB text), and 64 KiB read per capture. Evidence expires after 24 hours and is pruned on later store access; capture/skip decisions and existing prompt deletion/retention clear it. Session deletion itself preserves pending memory evidence and previously captured memories. These are logical limits, not secure erasure of SQLite/WAL copies or backups.
  • Use stable IDs for auto-capture additions so sequential crash/restart replay reuses the original per-project/prompt memory, including soft-deleted rows without resurrection. This does not provide distributed exactly-once semantics for optional semantic update/supersede operations or every multi-process crash interleaving.
  • Retain the exact Session.NotFoundError handling at the originating context lookup and meaningful error logging. When neither ready evidence nor live context exists, log an explicit skipped outcome and retain the request without spending its retry budget or inventing completed work.

Recovery requires evidence actually received, durably saved, and checkpointed ready by idle/deleted. The V2 stream is volatile: unseen events, unresolved association, eviction/expiry, or disconnect before a terminal checkpoint remain unrecoverable. Startup does not assume unfinished, uncheckpointed work is complete. This cannot reconstruct already deleted/unseen transcripts or revive exhausted retries. The README documents these limits.

Test plan

Verified in an isolated Linux cloud checkout with Bun 1.4.4:

  • 68 focused tests across eight files passed, covering actual database and real plugin event flow; deletion before delayed capture; disposal/restart replay without host lookup; V1/V2 mappings; private tags; bounds/expiry; project isolation; duplicate handling; stable add-path replay; old-schema migration preserving prompts; and older-empty-prompt starvation.
  • bun test --timeout 30000: 1,057 passed, 4 skipped, 0 failed. The allowance accommodates pre-existing slow profile/auto-update tests previously reproduced on untouched upstream; no source timeout setting changed.
  • bun run build and bun run check passed, including formatting, ESLint, and typecheck.

An independent bounded code review identified the starvation edge case, which is now fixed and tested, with no remaining high-confidence blocking findings within the reviewed scope. Windows runtime behavior has not been personally reproduced; hosted CI provides platform checks.

  • Exercised the change in the isolated Linux cloud checkout
  • Noted known limitations above and in the README

Checklist

  • Branch is based on main
  • bun test passes with the timeout allowance described above
  • bun run typecheck passes (included in bun run check)
  • bun run check passes (format + lint + typecheck)
  • Docs / README updated for the behavior change

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Phototonic added 2 commits November 2, 2026 18:53
@Phototonic
fix(capture): retain pending prompts when session context is unavailable
83b383f
@Phototonic
fix(capture): preserve final evidence across session deletion and res…
e00b301
…tart
@Phototonic Phototonic changed the title fix(capture): retain pending prompts when session context is unavailable fix(capture): preserve pending evidence across session deletion Nov 2, 2026
@Phototonic
Phototonic marked this pull request as ready for review November 2, 2026 09:02
EyJunge1 added 2 commits November 2, 2026 10:57
@EyJunge1
fix(capture): prefer live transcript over ready evidence on idle
8cd43ee
Keep durable evidence as the deletion/startup fallback so normal idle
capture still uses the richer host transcript instead of bounded parts.
@EyJunge1
fix(capture): seal evidence after idle/deleted checkpoints
39293a6
Prevent late buffered events from rebinding and clearing ready state,
keep observe non-rejecting so deleted-session capture still runs, and
cancel a pending idle timer when the session is deleted.
@EyJunge1
EyJunge1 merged commit e9a0d22 into tickernelz:main Nov 2, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 2, 2026
fix: harden cleanup vacuum and dreaming run feedback #480
Merged
chore(release): release v2.40.0 #481
Merged
@AlexandrosKyriakakis

AlexandrosKyriakakis commented Nov 18, 2026

Copy link
Copy Markdown

@Phototonic @tickernelz here you are: wile.ai

opencode-mem-479.mp4
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Phototonic @AlexandrosKyriakakis @EyJunge1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.