You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
capture: sid is bound via setCurrent then awaited — write-time identity races the live session #116
#108 listed a second finding under "Also open" that #113 deliberately does not fix (correctly — it is a seam decision, not a cooldown fix):
captureSession binds the session with setCurrent and then awaits a model call before writing, while gateContext() and appendMemory's stamp resolve identity from the global current sid at write time. The idle path could already race this but only fired on a quiet session; a compaction fires mid-turn, so the window is open during live activity by construction. The honest fix is threading the sid into the write instead of mutating module state.
#113 says this "deserves its own thread" but no thread existed — merging #113 with Fixes #108 would close the issue and silently orphan the finding. This issue is that thread.
The decision to make
Thread sid through the capture write path (captureSession → gated write → stamp/attribution) instead of resolving identity from module-global "current session" at write time, or document why the global is safe.
Spun out of the #103 review (2026-10-25); recorded 2026-10-26 while reviewing #113 so the fix-closes-issue path cannot swallow it.
Taking this - it is our finding, so the framing carries over: the honest fix is threading sid through the capture write path (captureSession -> gated write -> stamp/attribution) rather than resolving identity from the module-global current session at write time. The global is defensible for paths that never await before writing; capture's whole shape is awaits, so it does not get to use it.
Plan: red-first pin that makes a compaction capture land its write under a DIFFERENT session's stamp (two live sessions, one awaits a model call while the other goes active - deterministic via the harness seams, no wall-clock race), then thread the sid through and show the same pin green. setCurrent stays for the non-capture callers it legitimately serves.
Claimed and opened: #118 - fix threads the captured session's identity through GateContext.sessionID -> AppendMemoryInput.sessionID instead of reading getCurrent() back at persistence time. Red pin interleaves deterministically via a park seam in the model stub (blocked-under-hijacker's-evidence now, wrong repo stamp in the sibling timing shape - both caught while writing it); both threading arms individually kill-verified. Suite 490/0/5 + tsc clean.
Activity
WhollyMindless commentedon Oct 26, 2026
Taking this - it is our finding, so the framing carries over: the honest fix is threading
sidthrough the capture write path (captureSession-> gated write -> stamp/attribution) rather than resolving identity from the module-global current session at write time. The global is defensible for paths that never await before writing; capture's whole shape is awaits, so it does not get to use it.Plan: red-first pin that makes a compaction capture land its write under a DIFFERENT session's stamp (two live sessions, one awaits a model call while the other goes active - deterministic via the harness seams, no wall-clock race), then thread the sid through and show the same pin green.
setCurrentstays for the non-capture callers it legitimately serves.WhollyMindless commentedon Oct 26, 2026
Claimed and opened: #118 - fix threads the captured session's identity through GateContext.sessionID -> AppendMemoryInput.sessionID instead of reading getCurrent() back at persistence time. Red pin interleaves deterministically via a park seam in the model stub (blocked-under-hijacker's-evidence now, wrong repo stamp in the sibling timing shape - both caught while writing it); both threading arms individually kill-verified. Suite 490/0/5 + tsc clean.
fix(#116): capture gates and stamps the captured session, not the las…
Merge pull request #118 from WhollyMindless/fix/capture-sid-threading
chore(release): 0.14.6 [skip ci]
abogartz-opencode-self-improvement commentedon Oct 26, 2026
🎉 This issue has been resolved in version 0.14.6 🎉
The release is available on:
Your semantic-release bot 📦🚀