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
stop() and ephemeral-agent cleanup never close their ContextManagers, so strategies are never detached on teardown #550
stop() (src/framework.ts ~3746–3763) syncs and closes an owned store, but calls no ContextManager.close() for any agent first.
The cleanup returned for an ephemeral agent (~7705–7708) is empty ("Just release the CM"), so it releases nothing.
stop() waits for the framework's maintenance pass, not for a strategy's own speculative drain. connectome-host enables autoTickOnNewMessage, so that drain runs on every message.
context-manager #215 adds ContextStrategy.detach(), which ContextManager.close() calls, so that a closed manager's strategy stops compressing and draining. The framework's only ContextManager.close() is in offline-branch recovery, so none of that applies when the framework stops or releases an ephemeral agent.
Why it matters
At stop(), a speculative compression already out can land against a closed store. By reading, its post-call check then throws and is logged as a drain error: the call was paid for and its result lost.
A "released" ephemeral agent's strategy stays attached to the shared store, and its drain can keep calling the provider and writing under its namespace.
How it was found
Traced by the second reviewer while reviewing context-manager #215; each cited line was checked. The behaviour after the store closes is from reading, not from a run.
Suggested fix
Call contextManager.close() for each agent's manager before closing the store in stop(), and in the ephemeral cleanup.
Activity