Correction to Original Issue
The original issue incorrectly stated that no hook exists for session reset events. That was wrong.
OpenClaw's plugin SDK already provides before_reset as a PluginHookName (defined in plugins/types.d.ts, type PluginHookBeforeResetEvent). The hook fires before /new or idle-timeout resets. lossless-claw v0.4.0 does not register a handler for it — in fact, the plugin uses no api.on() hooks at all.
Question
Is this intentional?
We can see reasons why it would be:
- Messages are persistent. Nothing is physically lost on
/new. Everything stays in lcm.db and is recoverable via lcm_grep / lcm_expand.
- Forced compaction on thin context = poor summaries. If someone runs
/new after 3 messages, a forced summary would fragment the DAG with low-quality nodes.
- The LCM tools ARE the recovery mechanism. Four retrieval tools exist specifically for reaching into past conversations — whether summarized or not.
- The plugin deliberately uses only the ContextEngine interface, not event hooks. This looks like an architectural choice, not an oversight.
So the philosophy may be: "Summarize only when context-window pressure demands it, not prophylactically. The data is safe, the tools can find it."
Our Use Case
We added a before_reset handler (~40 lines) that forces compaction before /new resets. The motivation: when a new session starts, assemble() only returns summaries + fresh tail from the current conversation. Without a summary from the previous conversation, the agent starts with zero carried-over context — even though the raw messages exist in the DB.
The LCM tools can recover this, but it requires the agent (or user) to actively search for prior context. A summary written at reset would make context carryover automatic via assemble().
We're not sure this is the right trade-off. Forced summaries on short conversations would be noisy. But for longer conversations that reset before hitting the compaction threshold, it feels like a gap.
Is there a design reason this was left out, or would a PR with an opt-in compactOnReset: true config flag be welcome?
Environment
- OpenClaw: 2026.3.13+
- lossless-claw: 0.4.0
before_reset hook available in SDK since at least current OpenClaw release
Correction to Original Issue
The original issue incorrectly stated that no hook exists for session reset events. That was wrong.
OpenClaw's plugin SDK already provides
before_resetas aPluginHookName(defined inplugins/types.d.ts, typePluginHookBeforeResetEvent). The hook fires before/newor idle-timeout resets. lossless-claw v0.4.0 does not register a handler for it — in fact, the plugin uses noapi.on()hooks at all.Question
Is this intentional?
We can see reasons why it would be:
/new. Everything stays inlcm.dband is recoverable vialcm_grep/lcm_expand./newafter 3 messages, a forced summary would fragment the DAG with low-quality nodes.So the philosophy may be: "Summarize only when context-window pressure demands it, not prophylactically. The data is safe, the tools can find it."
Our Use Case
We added a
before_resethandler (~40 lines) that forces compaction before/newresets. The motivation: when a new session starts,assemble()only returns summaries + fresh tail from the current conversation. Without a summary from the previous conversation, the agent starts with zero carried-over context — even though the raw messages exist in the DB.The LCM tools can recover this, but it requires the agent (or user) to actively search for prior context. A summary written at reset would make context carryover automatic via
assemble().We're not sure this is the right trade-off. Forced summaries on short conversations would be noisy. But for longer conversations that reset before hitting the compaction threshold, it feels like a gap.
Is there a design reason this was left out, or would a PR with an opt-in
compactOnReset: trueconfig flag be welcome?Environment
before_resethook available in SDK since at least current OpenClaw release