Release v0.1.10 — Persistent Cortex storage and seamless auto-update#25
Merged
ApiliumDevTeam merged 9 commits intomainfrom Mar 9, 2026
Merged
Release v0.1.10 — Persistent Cortex storage and seamless auto-update#25ApiliumDevTeam merged 9 commits intomainfrom
ApiliumDevTeam merged 9 commits intomainfrom
Conversation
Release v0.1.9 — Ineru rename & Cortex 0.4.0
Pass --db flag to Cortex sidecar for Sled-backed persistent storage (~/.mayros/cortex-data/graph.sled). Add flush-before-update to prevent data loss during binary replacement, and dataDir config option. - Add dataDir to CortexConfig type and parser - Pass --db <dataDir>/graph.sled in sidecar spawn args - Create data directory on first start (mkdir -p) - Add flushCortexBeforeUpdate() — POST /api/v1/flush before replace - Integrate flush into installOrUpdateCortex() - Add cortex.dataDir uiHint in memory-semantic config - Bump REQUIRED_CORTEX_VERSION to 0.4.1 - Bump package version 0.1.9 → 0.1.10 - Sync 49 extension versions via plugins:sync
Add flushBeforeStop() to CortexSidecar to POST /api/v1/flush before SIGTERM, increase SIGKILL timeout to 10s, and add restartForUpdate() method. Add onBeforeReplace/onAfterReplace callbacks to installOrUpdateCortex so callers can wire sidecar stop/start around binary replacement.
Add displayText parameter to sendMessage so TUI shows a clean command label (e.g. /kg, /trace stats) instead of exposing raw AI instructions to the user. Affected commands: /tools, /kg, /trace, /team, /tasks, /workflow, /rules, /mailbox, /sync.
Addresses all identified gaps in Cortex sidecar management: - Capture stderr in ring buffer for crash diagnostics (getLastLogs) - Add stopping flag to prevent auto-restart during deliberate stop - Lock file in dataDir to prevent concurrent sidecar instances - Port availability check before spawn (detect port conflicts) - Auto-install binary on first start when not explicitly configured - Skip health monitor restart while sidecar is still starting - Drain pending write queue before stopping sidecar - Secrets follow dataDir with migration from ~/.mayros/ - Wire lifecycle callbacks from plugin to update-runner via registry - Pass actual host/port from config to flush-before-update
- Add 10s timeout to writeQueue.drain() during update and shutdown to prevent blocking if Cortex is unresponsive - Distinguish permission errors from lock conflicts in acquireLock - Log stale lock reclamation for diagnostics - Fix bug where external Cortex detection returned false instead of true (status was overwritten from "running" to "failed")
When the sidecar child process crashes and auto-restart triggers, acquireLock() found the existing lock with our own Node.js PID. Since the parent process is alive, the probe succeeded and the lock was refused — silently breaking all auto-restarts. Now checks if the lock belongs to the current process before probing, allowing self-reclaim for restart scenarios while still blocking concurrent instances from different processes.
## Summary - Pass `--db` flag to Cortex sidecar for persistent storage (`~/.mayros/cortex-data/`) - Graceful flush-before-update: sends `/api/flush` + SIGTERM before binary replacement - Lifecycle callback registry bridging plugin layer with update-runner - Sidecar hardening: lock files, port conflict detection, stderr capture, stale lock reclaim - Secrets migration to `dataDir`, auto-install when binary missing - Hide internal AI instructions from slash command display (`displayText` pattern) - Bump `REQUIRED_CORTEX_VERSION` to 0.4.1 ## Test plan - [ ] `pnpm build && pnpm test` — all tests pass - [ ] `mayros gateway` → verify `--db` in sidecar spawn args - [ ] Simulate binary update → data survives restart - [ ] Kill sidecar process → auto-restart reclaims lock and recovers - [ ] `/kg` and other slash commands show clean text to user
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.
Summary
--dbfor persistent Sled storage (~/.mayros/cortex-data/)/api/flush+ SIGTERM before binary replacementdataDir, auto-install when binary missingREQUIRED_CORTEX_VERSIONto 0.4.1Test plan
pnpm build && pnpm test— all tests pass/kg,/tools,/traceshow user-friendly text