Skip to content

OpenClaw plugin: coexist with memory-core + consolidate #49 + #58#66

Merged
kaghni merged 14 commits intomainfrom
feat/openclaw-coexist
Apr 21, 2026
Merged

OpenClaw plugin: coexist with memory-core + consolidate #49 + #58#66
kaghni merged 14 commits intomainfrom
feat/openclaw-coexist

Conversation

@kaghni
Copy link
Copy Markdown
Collaborator

@kaghni kaghni commented Apr 21, 2026

Summary

Consolidates and lands the two open OpenClaw plugin PRs (#49 autoupdate, #58 coexist-with-memory-core), resolves their merge conflicts cleanly, and adds real-world troubleshooting docs from a 2026-04-17 debug session.

Closes #49 and closes #58 — both OPEN and conflicting with recent main; rather than rebasing two branches in parallel, they're merged here with conflicts resolved and bugs fixed.

What's in this branch

From PR #58 (coexist with memory-core)

  • Remove kind: "memory" from openclaw/openclaw.plugin.json — hivemind no longer claims OpenClaw's memory slot
  • Remove addToLoadPaths() — plugin no longer mutates ~/.openclaw/openclaw.json
  • Create openclaw/README.md (didn't exist on main)
  • Update global README.md and SKILL.md

Why it matters: extensions/memory-core owns the dreaming cron ("0 3 * * *") and the light/REM/deep memory-consolidation phases. When hivemind declared kind: "memory", it grabbed the singular memory slot and silently killed those jobs. This is the openclaw-sanctioned coexist pattern (same as extensions/memory-wiki, documented in docs/plugins/memory-wiki.md): a memory-adjacent plugin that augments the active memory backend rather than replacing it.

From PR #49 (autoupdate / version-check)

  • Passive version check at plugin registration; logs update notice if behind
  • /hivemind_update command for explicit check

Fixes discovered during merge

New documentation

Troubleshooting section in both global and openclaw READMEs covering issues found during the 2026-04-17 debug:

  • Agent model tuning (Opus-4 default is too slow for memory workflows; recommend anthropic/claude-haiku-4-5-20251001)
  • OpenClaw's strict provider-prefixed + dated model-ID allowlist (rejects -latest and unprefixed IDs)
  • openclaw model <id> CLI being disabled by default (plugins.allow excludes model)
  • tools.elevated.allowFrom.<provider> gate for channel-triggered elevated commands
  • npm EACCES on self-update when OpenClaw is installed under a root-owned npm prefix

Test plan

  • npm run typecheck — clean
  • npm run build — 8 CC + 8 Codex + 1 OpenClaw bundles built
  • npm test — 918/918 passing across 41 files
  • Install via openclaw plugins install clawhub:hivemind and verify memory-core dreaming cron still runs
  • Verify /hivemind_update reports correct state against current main

Follow-ups (not in this PR)

  • Migrate getInstalledVersion/isNewer to the shared src/utils/version-check.ts helper (needs a small extension for openclaw's non-standard manifest filename)
  • Port recent CC/codex fixes to OpenClaw: 8KB output cap, SQL ESCAPE '\\', release-lock observability, src/utils/ helper migration

🤖 Generated with Claude Code

kaghni and others added 12 commits April 14, 2026 14:40
Check GitHub for newer versions on plugin registration. Since
child_process is stubbed in the OpenClaw bundle, auto-update isn't
possible — log a notice with the update command instead.
- Use npm registry instead of GitHub raw to avoid false update notices
  for unreleased versions on main
- Strip pre-release suffix before version comparison
- Add string type guard on pkg.version from registry response
auth.ts imports unlinkSync from node:fs but the OpenClaw esbuild
fs-wrap didn't export it, breaking the build.
npm registry has a different package named hivemind (0.1.2). The
OpenClaw plugin is published on ClawHub, not npm. GitHub raw is the
correct source for the latest version.
Checks GitHub for newer version and tells the user what command to run.
Cannot auto-update since child_process is stubbed in the OpenClaw bundle.
Resolves conflict by keeping both the org/workspace commands from main (PR #52)
and the hivemind_update command from the autoupdate branch. Also fixes a
reference to undefined GITHUB_RAW_PKG — the declared constant is VERSION_URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ner-clean

After merging PR #58 (removes kind:memory, drops readFileSync import) with
PR #49 (adds hivemind_update version-check that needs readFileSync), the
merged source had undefined readFileSync references. Moving the node:fs
and node:path imports inside getInstalledVersion() via dynamic import
keeps the version-check functional while satisfying the security scanner
intent from PR #58 (no top-level node:fs import in source).

Also adds /hivemind_update to the openclaw/README commands table.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- README: clarify hivemind runs alongside memory-core (dreaming cron,
  other memory-slot jobs unaffected)
- README: troubleshooting for agent-model tuning, allowlist rejects,
  disabled model CLI, elevated-command gotchas, EACCES on self-update
- openclaw/README: same troubleshooting, plus coexist callout
- Add /hivemind_update to global README commands table

Source: debug session 2026-04-17 diagnosing a user-reported "hivemind
broken in openclaw" that was actually the Opus-4 default model, the
disabled openclaw model CLI, and the strict model allowlist rejecting
legacy IDs. Documenting so the next user doesn't rediscover.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Apr 21, 2026

Claude finished @kaghni's task in 2m 39s —— View job


Two issues found:

  • openclaw/skills/SKILL.md — duplicate ## Commands section: new block added at line 27 but old block at lines 37–45 was not removed. View comment →
  • openclaw/src/index.ts:73 — passive update log says openclaw plugins install clawhub:hivemind while the /hivemind_update command (line 289) correctly uses openclaw plugins update hivemind; should be consistent. View comment →

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Coverage Report

No src/*.ts files changed in this PR.

Generated for commit 6c4a3dc.

Comment thread openclaw/skills/SKILL.md
- **Does NOT** modify OpenClaw configuration or replace the built-in memory plugin.
- All network requests go to `api.deeplake.ai` only.

## Commands
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new ## Commands block added here creates a duplicate — the original ## Commands section (lines 37–45 of the resulting file) was not removed, leaving two identical headings.

Delete the old ## Commands block (lines 37–45, starting with ## Commands through - \/hivemind_switch_workspace ``) to keep only the new, more detailed list above.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in this same commit (4cb3bde) — the diff removes the duplicate block. Only one ## Commands section remains, at line 27 of the resulting file. Verified locally and on origin.

Comment thread openclaw/src/index.ts Outdated
const manifest = await res.json() as { version?: string };
const latest = manifest.version ?? null;
if (latest && isNewer(latest, current)) {
logger.info?.(`⬆️ Hivemind update available: ${current} → ${latest}. Run: openclaw plugins install clawhub:hivemind`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The passive update log says openclaw plugins install clawhub:hivemind (install a new plugin), but the explicit /hivemind_update command (line 289) correctly says openclaw plugins update hivemind — these two messages should be consistent, and update is the right verb for an already-installed plugin.

Suggested change
logger.info?.(`⬆️ Hivemind update available: ${current}${latest}. Run: openclaw plugins install clawhub:hivemind`);
logger.info?.(`⬆️ Hivemind update available: ${current}${latest}. Run: openclaw plugins update hivemind`);

kaghni and others added 2 commits April 21, 2026 18:03
- SKILL.md had a duplicated `## Commands` H2 section (two identical headings
  break markdown anchors and confuse the reader). Consolidated into one
  section and added /hivemind_update.
- Passive update-available log said `openclaw plugins install clawhub:hivemind`
  but the explicit /hivemind_update command correctly says
  `openclaw plugins update hivemind`. Aligned both on the `update` verb —
  `update` is the right action for an already-installed plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pre-bumps from 0.6.39 to 0.6.40 so the ClawHub publish of this branch
matches the GitHub release version produced by release.yml on merge.
release.yml skips its auto-bump when the last commit message contains
'chore: bump version', so we avoid a double-bump on merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kaghni kaghni merged commit d3fc604 into main Apr 21, 2026
3 checks passed
kaghni added a commit that referenced this pull request Apr 21, 2026
Revert PR #66 (OpenClaw coexist) — merged by mistake
@kaghni
Copy link
Copy Markdown
Collaborator Author

kaghni commented Apr 21, 2026

This PR was merged (as d3fc604) and then reverted (as 8a94a72), so main lost all the fixes. Re-applied in #69 via git revert of the revert — clean 4-file diff with identical content, no cross-package version-bump noise this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant