Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge remote-tracking branch 'origin/release/3.2' into audit/pr1339-final
AkitaOnRails869a11fad2af
diff --cc CHANGELOG.mdindex 2a2448a7,576bfdf1..22b598a0--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -12,18 -12,29 +12,41 @@@ version in [`docs/changelog/`](docs/cha## [Unreleased]### Added+- 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. 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`. 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)## [3.1.0] - 2026-10-16