openclaw/test/hooks
Rex Liu b85810a550
feat(hooks): Add memory system hooks for session continuity
Adds two new bundled hooks:

1. session-backup: Automated hourly session backups with activity-based lifecycle
   - Tracks user activity via lastUserMessage timestamp
   - Creates hourly backups while user is active
   - Grace period (1-2h) triggers final backup then stops
   - Respects backupActive flag to avoid unnecessary work

2. context-aggregator: Aggregates memory into CONTEXT.md
   - Collects from hourly backups, daily notes, session summaries
   - Updates activity state from session logs
   - Provides memory management reminders
   - Creates unified context for session continuity

Also adds tests for session-backup hook covering:
- State management
- Activity detection
- Backup creation
- Full lifecycle simulation

Resolves the 'new intern each session' problem by providing structured
memory persistence that doesn't rely on agent behavioral compliance.
2026-01-26 21:57:06 -05:00
..
session-backup.test.ts feat(hooks): Add memory system hooks for session continuity 2026-01-26 21:57:06 -05:00