@happycastle/oh-my-openclaw 0.15.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,6 +66,11 @@ export function registerAgentEndReminder(api) {
66
66
  }
67
67
  }, { priority: 50 });
68
68
  }
69
+ function clearSession(sessionKey, api, reason) {
70
+ resetStore(sessionKey);
71
+ sessionCounters.delete(sessionKey);
72
+ api.logger.info(`${LOG_PREFIX} Todo store cleared (${reason}, session=${sessionKey})`);
73
+ }
69
74
  export function registerSessionCleanup(api) {
70
75
  api.on('session_start', async (event, ctx) => {
71
76
  if (event.resumedFrom)
@@ -73,10 +78,14 @@ export function registerSessionCleanup(api) {
73
78
  const sessionKey = ctx.sessionKey ?? ctx.sessionId ?? event.sessionId;
74
79
  if (!sessionKey)
75
80
  return;
76
- resetStore(sessionKey);
77
- sessionCounters.delete(sessionKey);
78
- api.logger.info(`${LOG_PREFIX} Todo store cleared for new session (${sessionKey})`);
81
+ clearSession(sessionKey, api, 'new session');
79
82
  }, { priority: 190 });
83
+ api.on('session_end', async (event, ctx) => {
84
+ const sessionKey = ctx.sessionId ?? event.sessionId;
85
+ if (!sessionKey)
86
+ return;
87
+ clearSession(sessionKey, api, 'session_end');
88
+ }, { priority: 50 });
80
89
  }
81
90
  export function resetTodoReminderCounters() {
82
91
  sessionCounters.clear();
package/dist/index.js CHANGED
@@ -114,7 +114,7 @@ export default function register(api) {
114
114
  safeRegister(api, 'session-cleanup', 'hook', () => {
115
115
  registerSessionCleanup(api);
116
116
  registry.hooks.push('session-cleanup');
117
- api.logger.info(`[${PLUGIN_ID}] Session cleanup hook registered (session_start)`);
117
+ api.logger.info(`[${PLUGIN_ID}] Session cleanup hooks registered (session_start, session_end)`);
118
118
  });
119
119
  safeRegister(api, 'todo-tools', 'tool', () => {
120
120
  registerTodoTools(api);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happycastle/oh-my-openclaw",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Oh-My-OpenClaw plugin — multi-agent orchestration, todo enforcer, ralph loop, and custom tools for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",