github chandra447/pi-hermes-memory v0.9.11

latest releases: v0.11.0, v0.10.0
25 days ago

Highlights

Direct transport now works with extension-registered providers (#298, thanks @Zaldaryon): review, flush, correction, and consolidation completions called pi-ai's global completeSimple, which only resolves builtin api ids. A model whose provider comes from pi.registerProvider() (for example kiro/*) failed with No API provider registered for api: kiro-api and always fell back to the subprocess. The direct call now streams through ctx.modelRegistry.streamSimple (added in Pi 0.86.0, earendil-works/pi#8964) when the host provides it, and keeps the global call as the fallback for older hosts. The peer range is unchanged.

Provider failures keep their cause (#299): Pi reports provider failures as an error message, not a throw. The direct path only re-threw auth rejections, so every other error fell through to the parser and settled as parse_error with no error text, hiding the cause in the "failed in both transports" warning. Any stopReason: "error" now settles as provider_error carrying Pi's errorMessage; auth rejections still take the rotation retry first. On a host without ModelRegistry.streamSimple (Pi before 0.86.0), No API provider registered for api: … now says the provider is registered by an extension and to upgrade Pi to 0.86.0 or later. Fallback behaviour is unchanged: both reasons already fell back to the subprocess. An error response that still carried parseable content is no longer applied, so a failed response cannot write memory.

Memory subprocess children are locked down (#280, thanks @dawidmachon, closes #275; #288): the pi -p --no-session fallback shared by background review, session flush, correction save, and consolidation ran with Pi's full default toolset inside the session's working directory. A weak llmModelOverride model could wander out of memory operations and edit project files with nothing to correlate the edits against.

  • Child argv now carries --tools memory_add,memory_replace,memory_remove, enforced by Pi's tool registry (built-in and extension tools alike) at the single argv choke point both builders share, so the retry-without-overrides path is covered too. The tool names live in one shared constant (MEMORY_WRITE_TOOL_NAMES) consumed by both tool registration and the child argv, with a drift test, because Pi silently ignores unknown --tools names.
  • Children no longer receive the injected <memory-policy> block, which named memory_search, session_search, and skill_manage, all hidden by the allowlist. The watchdog marks every memory child with PI_HERMES_MEMORY_CHILD=1 and before_agent_start skips the policy block for children in every style. Standing instructions still apply and legacy-inject mode is unchanged.
  • The child argv also carries --exclude-tools mcp__*, because on Pi 1.0.4+ --tools keeps MCP tools unless an entry starts with mcp__. It is inert on older Pi. --no-mcp is not used, because Pi before 1.0.4 exits on the unknown option.
  • The child's working directory is unchanged, so project-scoped memory writes still bind correctly.

Fixed

  • Real consolidation errors are no longer hidden behind model-scope warnings (#278, thanks @ZeR020): consolidation children use --no-extensions but still resolve enabledModels, so their stderr could begin with harmless Warning: No models match pattern … lines that filled the diagnostic excerpt. A shared cleanChildStderr helper strips ANSI and omits only those startup warning lines (warning-only output is preserved), and consolidation and background-review diagnostics now use it.
  • Ephemeral review sessions are pruned on every platform (#279, thanks @joshua-zyy, closes #266): pruneEphemeralReviewSessions() hardcoded the Linux /tmp/pi-hermes-prompt- prefix, so on Windows and macOS (per-boot /var/folders/… temp dirs) it matched nothing. It now matches the pi-hermes-prompt-…/prompt.md attachment wrapper separator-agnostically on user messages, and no longer depends on COUNT(*) = 1, which missed child sessions with an indexed reply. On one real 1,506-session Windows index the old query matched 0 rows where 52 carried the marker.
  • Multi-line mirror entries lose their metadata comment (#283, thanks @Arteiimis, closes #282): parseMetadataComment in the SQLite mirror lacked the s regex flag, so an entry whose body contained a newline kept its <!-- created=…, last=…, project64=… --> comment in content and lost its project scope. On a real 128-row store, 6 rows had the comment leaked, exactly the 6 multi-line entries.

Performance

  • Memory lookups are indexed by scope and content (#293, thanks @Awlaursen, closes #292): reconcileMarkdownMemoryScope runs one syncMemoryEntry lookup per Markdown entry inside a single transaction. With only single-column indexes each lookup scanned a whole target/category slice, holding the write lock past the 5,000 ms busy_timeout (6,367 ms seen during one memory_add) and making live indexing in other processes fail with database is locked. New index idx_memories_scope_content ON memories(target, project, category, content), created for new databases and added on every open for existing ones. On a 418 MB copy with 16,471 memory rows, the largest failure scope alone went from 28,193 ms to a total of 246–806 ms across all 10,444 failure lookups; building the index takes about 0.3 s.

Release engineering

  • Automated publishing with npm trusted publishing (#289): publish.yml runs verify (tag↔package.json guard, prerelease guard, npm ci, tsc, npm test, npm run check:production) → npm publish via OIDC with provenance → GitHub Release, triggered by a v* tag, a published GitHub Release, or dispatch. release.yml ("Prepare release") bumps the version, promotes the changelog, tags, and dispatches the publish. scripts/check-production-install.mjs no longer crashes on npm 12's changed npm pack --json shape. See docs/PUBLISHING.md.

Tests

  • 59 of 59 test files pass; tsc and npm run check:production are clean.
  • New regression tests: registry streaming for an api id absent from the global registry (and streamSimple stays bound to the registry), error-response cause and upgrade hint, child --tools/--exclude-tools argv on every shape plus a registration drift test, a real watchdog spawn reading back the child marker, EXPLAIN QUERY PLAN coverage for all four NULL/non-NULL scope combinations, multi-line mirror metadata, cross-platform ephemeral session pruning, and model-scope warning stripping.

Contributors

Full changelog: v0.9.10...v0.9.11

Don't miss a new pi-hermes-memory release

NewReleases is sending notifications on new releases.