Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge branch 'pr-822' into release/2.5
AkitaOnRailse3b2de1bfb74
diff --cc CHANGELOG.mdindex 74102829,ae9b7566..dd164839--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -8,59 -8,12 +8,64 @@@ and this project adheres to [Semantic V## [Unreleased]### Added+- `auto_improve.patchable_page_prefixes` makes the folders whose page bodies the+ reviewer reads configurable, defaulting to the historical `_rules/` and+ `procedures/`. Only those two folders' contents were ever sent; every other+ page reached the model as a single title line, so a project keeping its+ durable knowledge in `decisions/` or `gotchas/` — with no `_rules/` pages at+ all — sent no page bodies, and the reviewer re-proposed invariants that were+ already written down, at high confidence, indefinitely. Existing configs are+ unchanged. (#834)+- `ai-memory finalize-session --reopen --session-id <uuid>` re-finalizes a+ session that already ended, for agents without a true session-end event+ (Antigravity CLI, Kiro, ZCode, Pool) whose conversation continued after a+ first manual finalize: the discovery step now accepts `include_ended=true`+ on `GET /admin/open-sessions` for an exact session id (rejected without+ one, so reopening stays exact-id-only and never a bulk operation), and the+ server's normal session-end path re-runs over the new observations+ (updated summary page via supersession, new handoff, opt-in+ consolidation). Re-running with nothing new since the first end remains a+ harmless no-op. The default finalize behavior is unchanged: ended sessions+ stay invisible unless `--reopen` is passed. (#836)+ - Added per-execution `AI_MEMORY_CAPTURE_OWNER` context for external lifecycle+ producers. Updated native hooks, script bundles and generated integrations+ suppress capture while preserving supported handoff delivery and MCP recall.+ Documented producer provenance and stable retries through the existing hook+ ingestion API, without changing its schema or standalone defaults. (#821)+### Fixed+- `ai-memory serve` no longer leaked file descriptors from half-open HTTP+ connections until `EMFILE`, breaking the healthcheck (an unauthenticated+ availability/DoS). A hook or MCP client whose peer died without sending FIN+ (laptop sleep, a VPN/Tailscale flap, an abrupt kill) left its accepted+ socket `ESTABLISHED` forever, since the OS default has TCP keepalive off —+ each dead peer leaked one fd, exhausting the 1024-fd default in roughly 2-3+ days of normal churn. Accepted connections now get TCP keepalive via+ `socket2`, tunable with the new `tcp_keepalive_secs` config key (default+ 60s; `AI_MEMORY_TCP_KEEPALIVE_SECS=0` disables keepalive). This closes the+ half-open-socket half of the fd leak; the rmcp session-table half was+ already fixed in 2.4.0 by the rmcp 2.x bump. (#792)+- `ai-memory bootstrap` no longer returns a 500 when the LLM emits a page+ path containing a Windows-illegal character (e.g. a `:` copied verbatim+ from a conventional-commit subject like `build(sandbox): orchestrate`).+ Such a path passed the deliberately tolerant `PagePath::new` and only+ failed later at `ensure_portable` inside the atomic wiki write batch,+ which aborted every page in the run, not just the offending one. Bad+ paths are now sanitized (illegal characters replaced with `-`, directory+ shape preserved) before validation, so the run and its other pages+ survive; a path `ensure_portable` still rejects after sanitizing is+ skipped with a warning instead of failing the batch. (#847)+- The Windows release checksum (`ai-memory-windows-x86_64.zip.sha256`) is now+ written with a LF terminator instead of CRLF. `Out-File`'s Windows line+ ending made `sha256sum -c` fail with `No such file or directory` — the CR+ is read as part of the filename — on the WSL2 and Git Bash paths where that+ is the natural command, and placed a stray byte in the release body's+ checksum block, which concatenates every platform's file. The zip's smoke+ test now requires LF rather than tolerating either, so the format the+ release claims is the format it ships. (#838)++## [2.4.0] - 2026-09-21+### Security- Bumped `rmcp` to 2.x (2.2.0), resolving three MCP transport advisories:GHSA-9pj6-vhgr-3mwh (unauthenticated Streamable-HTTP session-table leak /