Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge PR #605: wire Codex SessionEnd hook (#604) [2.1]
AkitaOnRails41bde8cdc920
diff --cc CHANGELOG.mdindex 758850e4,fa626e4f..af8c62e5--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -7,84 -7,18 +7,95 @@@ and this project adheres to [Semantic V## [Unreleased]+ ### Added+ - `install-hooks --agent codex` now wires Codex's `SessionEnd` hook, so a+ finished Codex session gets the same automatic end-of-session summary+ and cross-agent handoff Claude Code already gets. Codex shipped a+ first-class `SessionEnd` event in Codex CLI 0.145.0 (openai/codex#33895);+ the `hooks/codex/session-end.{sh,ps1}` scripts already existed and only+ needed adding to the Codex hook profile. On older Codex the event key is+ inert; `ai-memory finalize-session --agent codex` remains the fallback.+ `merge_codex_payload` no longer strips a `SessionEnd` key on every apply+ — a third-party `SessionEnd` hook is preserved alongside ours. ([#604])+### Fixed+- `install-hooks --agent antigravity-cli` on native Windows now emits+ an unquoted hook `command` (#611). The native-binary rendering wrapped+ the executable, `--data-dir`, and `--server-url` in double quotes, but+ Antigravity runs the string through `cmd /c "<string>"` without+ stripping inner quotes, so `"C:\…\ai-memory.exe"` was "not+ recognized", every hook failed, and the cp850 (non-UTF-8) error text+ aborted the whole `agy` session. Antigravity's command is now rendered+ bare; other Windows agents keep their quotes.++## [2.0.2] - 2026-09-03++### Fixed+- Web UI: OKF bundle-index links (and any relative in-wiki link) no+ longer 404 (#603). Relative markdown link targets are now rewritten to+ project-scoped URLs — the same convention `[[wikilinks]]` use — instead+ of resolving against the web mount's `<base href>`, and a namespace+ (directory) path such as `.../p/_lint/` now lists the pages under it+ rather than returning 404. External links, anchors, and dangerous+ schemes are untouched by the rewrite.+- Pages with an empty frontmatter `title` no longer read back titleless+ or trip a bogus duplicate-title lint (#599). Auto-improve could store+ `title: ""` while the page had a proper `# H1`; now `memory_read_page`+ derives the title from the H1 (then the path stem) when the stored one+ is blank, the duplicate-title lint ignores blank titles instead of+ collapsing them into one `Multiple pages share title ""` finding, and+ the consolidator derives a title from the body H1 at write time so new+ pages never store an empty one. The DB `title` column (search) was+ already correct; this aligns the frontmatter-title readers with it+ without rewriting stored pages.+- Local-embedding model download (`fetch_model`) now bounds a stalled+ connection instead of hanging startup forever (#602): a 30s connect+ timeout and a generous 600s overall ceiling (large model files, so+ not the inference clients' flat 120s that would fail a slow download).+- The OKF v0.2 migration no longer crash-loops on startup with a+ libgit2 `invalid object specified … class=Tree` error that left the+ server unable to boot (#594). The wiki commit re-hashed files through+ libgit2's index, whose stat cache could trust a cached blob OID absent+ from the object database (a store carried across libgit2/git versions,+ or an interrupted earlier operation) — `write_tree` then aborted and,+ because the migration commits through that path, every restart failed.+ The commit now clears the index before staging so every file is+ re-hashed from the working tree. (The Docker runtime ships no `git`,+ so the fix is in-library, not a CLI fallback.)+- HTTP headers that carry a credential in an opaque value are now redacted+ before reaching durable storage. Previously such a header matched no+ built-in pattern unless it used the `Bearer` keyword or an+ `UPPER_SNAKE_TOKEN=` shape. The bearer rule requires the literal keyword,+ and the generic env-var rule requires `[A-Z][A-Z0-9_]*_TOKEN`, which never+ matches a kebab-case header name. `X-Amz-Security-Token` (AWS SigV4),+ `X-Api-Key`, `Private-Token` (GitLab), and `Ocp-Apim-Subscription-Key`+ (Azure) all fall in that gap, and tool output echoing a `curl` invocation+ is a common way they reach capture. A `key` or `token` suffix on its own+ does not imply a secret, so it must be qualified by an auth word:+ `Idempotency-Key`, `Continuation-Token` and storage partition keys are+ left intact and stay readable in captured output.+- `install-hooks --agent zcode --apply` no longer reports a hooks block+ ZCode has thrown away as `no-op … (already up to date)` (#600). ZCode+ validates `hooks.events` strictly and rejects the whole block, including+ ai-memory's own entries, over a single key it does not recognize, so+ capture never ran (`hookCount: 0`). Apply only ever merged the six event+ keys it writes, so a key it does not write was neither inspected nor+ reported, the file kept matching byte for byte, and the report claimed+ the install was current. Apply now also withdraws ai-memory's own+ entries from event keys it no longer writes, wherever they sit, and+ reports what it found: a warning naming any key it withdrew from, and a+ note for a key left unable to run anything, both naming the config file.+ **Changed output:** an unchanged ZCode config with such a key now reports+ `no-op … (unchanged; see the notes below)` instead of `already up to+ date`, so a redirected stdout no longer carries the reassurance without+ the cause. Event keys are never deleted and hooks ai-memory did not write+ are never removed, so a key holding someone else's hook is reported, not+ touched.+- OpenCode Go requests now send `User-Agent: ai-memory/<version>` and a+ per-operation `x-opencode-session` header. Session consolidation and+ auto-improvement reuse the captured ai-memory session ID, while retries and+ structured-output fallback keep the same ID instead of appearing as unrelated+ requests (#608).- `as_of` time-travel queries and the entity retrieval stream now workon real stores. Both read the entity index, which was populated onlyfrom an LLM consolidator's `entities:` frontmatter — absent on the