Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge branch 'main' into release/3.2
AkitaOnRailsdcb494770720
diff --cc CHANGELOG.mdindex 33e89f1b,b4517043..b8876c71--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -11,86 -11,14 +11,93 @@@ version in [`docs/changelog/`](docs/cha## [Unreleased]+### Added+- Added first-party Cline CLI lifecycle and MCP support. `install-hooks+ --agent cline --apply` writes Cline's nine supported event files globally or+ per project, refuses user-owned and symlinked targets, and keeps embedded+ bearer credentials owner-only. `install-mcp --client cline --apply` writes+ Cline's top-level transport fields and explicitly selects Streamable HTTP.+ Detached start hooks recover handoffs through MCP; yolo mode disables hooks.+ Also added `install-mcp --client freebuff --apply`, which registers the+ sessionless stdio bridge in `~/.agents/mcp.json` without starting another+ ai-memory server. (#1335)+- Added `[ingest] drop_events` (env `AI_MEMORY_INGEST__DROP_EVENTS`), an+ opt-in list of hook event kinds the server drops before storing them, next+ to the existing `drop_tool_use_id_prefixes` and `drop_tool_names`. A dropped+ event gets the same 202, `dropped_by_policy` metric and log as the other+ policy drops, before the rate limiter, the ingest semaphore and the+ sanitizer. Subagent classification precedes every id, name, and kind matcher,+ so a matching marked event still seeds tracking for its unmarked tail. The+ default drops nothing. `Config::load` checks each value+ against the typed event kind and rejects unknown kinds and `session-start`+ and `session-end`, which open and close sessions. The motivating case is+ `pre-tool-use`: in one production store about 87% of those observations had+ an empty body, and each pairs with a `post-tool-use` that carries the+ content. With `pre-tool-use` dropped, a session whose only work was a tool+ call that never finished now ends as lifecycle-only. (#1339)+- Added opt-in `[sessions] idle_end_after_hours` (env+ `AI_MEMORY_SESSIONS__IDLE_END_AFTER_HOURS`; default `0`, off; range+ `1..=8760`). When it is set, the `serve` maintenance tick ends open sessions+ with no activity for that many hours, such as a harness that crashed or a+ terminal closed before `SessionEnd` fired. A substantive session gets its+ `sessions/<id>.md` summary page, attributed to the session's owner, and its+ consolidation job. A boundary-only session ends lifecycle-only and releases+ the handoff it had accepted. The tick creates no handoff of its own and skips+ sessions bound to an active managed run. A real `SessionEnd` or checkpoint+ that lands while the tick runs wins, and the tick leaves that session alone.+ `ended_at` is the time of the tick; the session's last activity goes in the+ audit row. (#1338)+- Added first-party DeepSeek Harness (DSH) lifecycle capture. `install-hooks+ --agent dsh` (aliases `deepseek-harness`, `deepseek_harness`) stages the+ new `hooks/dsh` bundle, writes a generated Claude Code `hooks.json`, and+ prints a Cordis patch fragment that mounts DSH's official+ `@deepseek-ai/dsh-hooks-claude-code` bridge on+ `$DSH_HOME/profiles/<profile>/cordis.patch.yml` (the patch file itself is+ never auto-written). DSH sessions are stored as `agent=dsh`, and its bridge+ forwards Claude Code-shaped tool payloads, so `[capture] ignore_paths`+ exclusions apply to its file, search and shell calls (Windows `pwsh`, POSIX+ `bash`) like any other Claude-shaped adapter; the reserved Code Mode+ `run_code` transport that its `headless` profile calls is treated as inline+ program source. The bridge+ delivers exactly seven events (no `PreCompact` or `SessionEnd`) and runs+ `SessionStart` detached, so finished sessions close with+ `finalize-session --agent dsh` and pending handoffs are recovered via+ `memory_handoff_list` / `memory_handoff_accept`. (#1337)+- Added an Antigravity skill root family. `install-skills --agent antigravity`+ (aliases `antigravity-cli`, `agy`; also `install-instructions+ --skills-agent antigravity`) writes the managed Agent Skills to both global+ roots Antigravity reads, `~/.gemini/config/skills` (App and IDE) and+ `~/.gemini/antigravity-cli/skills` (CLI), or to the workspace+ `.agents/skills` with `--scope project`. `ai-memory setup` now uses it for+ Antigravity, which until now got its skills only in `~/.agents/skills`, a+ directory Antigravity does not read globally, and `uninstall --only skills`+ sweeps both roots. MCP-driven routing refresh and `backup-agents` expose and+ preserve the same roots, including the shared project `.agents/skills`.+ (#1357)++- Added a read-only wiki link graph in `/web`. The header **Graph** link opens+ `/web/graph`, a server-rendered map of resolved wikilinks whose endpoints sit+ in different projects, plus a table of those edges. Each project page links+ to `/web/w/<workspace>/<project>/graph`, which shows that project's latest+ unexpired pages and the resolved same-project links between them as an SVG+ and a table. Both pages are HTML with no JavaScript.+ `GET /api/v1/graph` now accepts `workspace` and `project` together to return+ only edges that touch that project (passing only one of them is `400`), and+ `GET /api/v1/workspaces/{workspace}/projects/{project}/graph` returns the+ in-project node and edge lists. A project graph keeps at most 120 pages,+ preferring those with the most same-project neighbours and then the most+ recently updated; the store applies that cap before loading nodes or their+ selected edges into the process. Expired pages stay hidden. An edge still+ requires both ends to be readable.++ ## [3.1.1] - 2026-10-17+### Fixed+ - Prevented the Windows executable from overflowing its small default main+ thread stack as the async CLI command tree grows. The top-level dispatch now+ runs on an explicitly sized stack on Windows; the native Windows suite had+ reached the point where every integration test that launched `ai-memory`+ aborted before handling its command.- Fixed native hook events getting stranded forever when a harness killed theprocess after the spool file was synced but before its atomic rename. A laterdrain adopts complete, valid `*.json.tmp` entries after a five-minute grace