feat(sleep): add Sleep System for cognitive maintenance and memory co…#1
Open
bravostation wants to merge 310 commits intomainfrom
Open
feat(sleep): add Sleep System for cognitive maintenance and memory co…#1bravostation wants to merge 310 commits intomainfrom
bravostation wants to merge 310 commits intomainfrom
Conversation
* docs: document cacheRetention parameter (openclaw#6240) * docs: standardize cacheRetention value quoting style * style: format anthropic.md table * Docs: align cacheRetention inline example --------- Co-authored-by: Sebastian <sebslight@gmail.com>
* Docs: add zh-CN entrypoint translations * Docs: harden docs-i18n parsing
…penclaw#5967) * docs: fix anchor link for Google Vertex/Antigravity/Gemini section * Docs: fix model provider MDX markers --------- Co-authored-by: Sebastian <sebslight@gmail.com>
* fix: satisfy lint curly rule * docs: apply oxfmt formatting
…claw#5663) * docs(install): add pnpm approve-builds step for global installs pnpm requires explicit approval for packages with build scripts. Without running `pnpm approve-builds -g`, openclaw and its dependencies (node-llama-cpp, sharp, protobufjs) won't have their postinstall scripts executed, causing runtime errors. Fixes openclaw#5579 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(install): clarify pnpm reinstall step after approve-builds Address review feedback: after running `pnpm approve-builds -g`, users need to re-run the install command for postinstall scripts to actually execute. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Update remaining __moltbot__ references in canvas skill documentation to match the CANVAS_HOST_PATH constant (/__openclaw__/canvas).
* Docs: Direct link to BotFather on Telegram, sparing users from searching and potentially encountering impostors. * Update numbering syntax Update numbering syntax to match PR to latest doc layout. * Docs: add BotFather verification note --------- Co-authored-by: Sebastian <sebslight@gmail.com>
* docs: add device pairing section to Control UI docs Explains that new browser connections require one-time pairing approval, what error message users will see, and how to approve devices using the CLI. This was a gap in the documentation that caused confusion for users connecting via Tailscale Serve. * docs: clarify Control UI pairing error * docs: clarify device revoke flags --------- Co-authored-by: Lucifer (via OpenClaw) <lucy@neuwirth.cc> Co-authored-by: Sebastian <sebslight@gmail.com>
…enclaw#4502) Co-authored-by: Jarvis <jarvis@openclaw.ai> Co-authored-by: CLAWDINATOR Bot <clawdinator[bot]@users.noreply.github.com> Co-authored-by: Shadow <shadow@openclaw.ai>
* docs(discord): clarify exec approvals UI * Add link for slash command in Discord exec approvals Updated documentation to include a link for the slash command used in Discord exec approvals. * docs(discord): move exec approvals note * docs(discord): document exec approvals config * docs(discord): reorder exec approvals config --------- Co-authored-by: Luke K (pr-0f3t) <2609441+lc0rp@users.noreply.github.com>
Co-authored-by: hansbbans <hansbbans@users.noreply.github.com>
- Fix @1 -> $1 in landpr.md - Fix $@ -> $1 in reviewpr.md - Remove stray /reviewpr line from reviewpr.md - Delete old pr.md (replaced by reviewpr.md and landpr.md)
* improve exe.dev setup instructions 1. Fix device approval command 2. Clarify where Gateway token can be found * Update device approval instructions in exe-dev.md Clarify instructions for approving devices in OpenClaw.
The previous migration to tsdown was reverted because it caused a ~20x slowdown when running OpenClaw from the repo. @hyf0 investigated and found that simply renaming the `dist` folder also caused the same slowdown. It turns out the Plugin script loader has a bunch of voodoo vibe logic to determine if it should load files from source and compile them, or if it should load them from dist. When building with tsdown, the filesystem layout is different (bundled), and so some files weren't in the right location, and the Plugin script loader decided to compile source files from scratch using Jiti. The new implementation uses tsdown to embed `NODE_ENV: 'production'`, which we now use to determine if we are running OpenClaw from a "production environmen" (ie. from dist). This removes the slop in favor of a deterministic toggle, and doesn't rely on directory names or similar. There is some code reaching into `dist` to load specific modules, primarily in the voice-call extension, which I simplified into loading an "officially" exported `extensionAPI.js` file. With tsdown, entry points need to be explicitly configured, so we should be able to avoid sloppy code reaching into internals from now on. This might break some existing users, but if it does, it's because they were using "private" APIs.
…ays using `tsdown` to build now.
…nsolidation Implements a scheduled, offline-first Sleep System that runs during user inactivity: Shallow Sleep (Maintenance): - Config validation and integrity checks - Credential expiry detection - Integration connectivity probes - Update checks (OpenClaw, dependencies, tools) - Security scans (npm audit, credential patterns) - Development radar (new models, protocol updates) Deep Sleep (Memory Consolidation): - Memory pruning (remove stale chunks) - Memory compaction (summarize sessions) - Medium-term memory processing - Long-term memory promotion - Core memory extraction (identity-shaping patterns) Memory Hierarchy: - Short-term: Daily interactions (pruned during sleep) - Medium-term: Searchable context (promoted on reinforcement) - Long-term: Auto-loaded stable facts - Core: Identity-shaping behavioral patterns Configuration via agents.defaults.sleep with customizable: - Sleep window (default: 03:00-06:00) - Idle requirements (default: 45 minutes) - Task toggles and thresholds Includes: - Full documentation (docs/gateway/sleep.md) - Unit tests (51 tests passing) - Type-safe config with Zod validation
- Add LLM reflection layer for identity-aware memory evaluation - Include SOUL.md, IDENTITY.md, core/long-term memories in LLM context - Store memories in workspace (MEMORIES-CORE.md, MEMORIES-LONG.md) - Use claude-opus-4-5 by default for high-quality reasoning - Add config: sleep.deep.llmReflection with provider, model, thresholds - Integrate LLM reflection as Phase 6 in deep sleep
- Memory tier markdown files now contain clean single-line entries - Each line has a brief 'why' label (Preference, Value, Pattern, etc) - No metadata, timestamps, or confidence scores in MD (context-friendly) - Full metadata stored in separate JSON files for sleep processing - JSON files live in memory/ dir alongside medium-term markdown - Updated docs with new file structure and linking tip
Follow same pattern as core/long-term: - memories-medium.md: clean single-line list for search - memories-medium.json: full metadata for sleep processing All memory tier files now have consistent format.
- workspace-sync.test.ts: tests for MD/JSON file generation - phases.test.ts: tests for shallow and deep sleep phases - Verifies clean markdown format, JSON metadata, round-trip integrity - Tests abort handling and phase execution
- memory-conversion.test.ts: JSON→MD with reason/why explanations - shallow-health.test.ts: credential expiry and version detection - e2e.test.ts: full sleep cycle tests - Updated types to include reason field for core/long-term memories - Updated prompts to request reason for core memory synthesis
New tasks for shallow sleep: - api-key-validation: Validates API keys by making lightweight requests to provider endpoints (Anthropic, OpenAI, Google, Groq, Together, etc.) - system-dependencies: Checks brew packages, OS updates, Node/Git versions, and essential CLI tools (curl, jq, sqlite3) Config additions: - tasks.apiKeyValidation: Enable live API key testing - updates.checkSystemDependencies: Enable brew/OS/tool version checks Tests: - api-system-tasks.test.ts: 16 tests for new tasks - Integration tests verify tasks run in shallow sleep Total sleep tests: 112 passing
- Add gracePeriodHours, maxPrunePercentPerCycle, fuzziness to pruner - Add minAgeHoursForPromotion, maxPromotePercentPerCycle to promoter - Add maxPerCycle limit to core memory extraction - Expand API key validation for tools (Brave, Firecrawl, ElevenLabs, Perplexity) - Add skill API key validation from config - Add rate limit parsing from response headers - Add doctor integration task (state, security, config checks) - Add package manager task (outdated, audit) - Update docs with new safeguard config options
0367bed to
df351e0
Compare
bravostation
pushed a commit
that referenced
this pull request
Feb 4, 2026
bravostation
pushed a commit
that referenced
this pull request
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nsolidation
Implements a scheduled, offline-first Sleep System that runs during user inactivity:
Shallow Sleep (Maintenance):
Deep Sleep (Memory Consolidation):
Memory Hierarchy:
Configuration via agents.defaults.sleep with customizable:
Includes: