Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge origin/main into issue/801-native-cli-upgrade
Ruben Licio Reisb198e7c68bdc
diff --cc CHANGELOG.mdindex d89ad802,9c59817a..847c5799--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -7,19 -7,78 +7,91 @@@ and this project adheres to [Semantic V## [Unreleased]+### Added+- Native `ai-memory upgrade` for GitHub-release Unix installs (Linux/macOS):+ downloads the matching release tarball, verifies the `.sha256` sidecar,+ atomically replaces the on-disk binary (and a sibling `hooks/` tree when+ present), then re-runs `install-hooks --apply` for staged agents. Refuses+ package-managed paths (Homebrew/AUR/`/usr`), containers, and Windows+ self-replace; the Docker wrapper's `upgrade` path is unchanged. Pin with+ `--version` / force a re-download with `--force`. Optional+ `AI_MEMORY_RELEASE_BASE_URL` / `release_base_url` overrides the Releases+ base for mirrors and hermetic tests (loaded via `Config`, not ad-hoc env).+ Downloads refuse bodies over 128 MiB (Content-Length and streamed cap).+ (#801)++ ### Security+ - Bumped `rmcp` to 2.x (2.2.0), resolving three MCP transport advisories:+ GHSA-9pj6-vhgr-3mwh (unauthenticated Streamable-HTTP session-table leak /+ DoS), GHSA-33f5-2c5q-wgwj (missing OAuth resource-field validation), and+ GHSA-9g45-5xwm-f3wc (custom headers leaking to cross-origin redirect+ targets). Behavior-preserving: the only source change is the+ `rmcp::model::Content` → `ContentBlock` rename (imported under the prior+ name), the feature set is unchanged, and the 23-tool MCP surface is+ unaffected. (#794)++ ### Docs+ - `docs/llm-providers.md` now covers the `opencode` LLM provider, which has+ shipped since 1.x but was missing from the recommended-defaults table:+ `OPENCODE_API_KEY` as the only credential, Go as the default endpoint, Zen+ via `AI_MEMORY_LLM_BASE_URL`, the built-in default model, per-catalogue+ model ids, and which model goes through the Responses endpoint (#763).++ ### Fixed+ - The Windows Docker wrapper (`bin/ai-memory.ps1`) now forwards the same+ provider credentials and host-config env vars as the POSIX wrapper into the+ helper container. A host-exported `GEMINI_API_KEY` / `GOOGLE_API_KEY`,+ Copilot token, `OPENCODE_API_KEY`, `CLAUDE_CONFIG_DIR`, or+ `AI_MEMORY_WORKSTREAM_ID` previously never reached `Config::load`, so+ `llm-test`, Copilot auth, OpenCode, and a relocated Claude config all+ reported "not configured" on native Windows Docker Desktop even though the+ same export worked through `bin/ai-memory`. The POSIX wrapper also now+ forwards `OPENCODE_API_KEY`. (#803)+ - `Config::load` now treats Windows `%USERPROFILE%` (then `dirs::home_dir`) as+ the operator home when `AI_MEMORY_HOME` and `$HOME` are unset. Native+ Windows often has no `HOME`, so the #103 catch-all guard — skip a stored+ `repo_path` equal to the user profile so it cannot prefix-match every+ project beneath it — was inert there and a home-directory project could+ swallow unrelated cwds. (#804)+ - Automatic handoff selection and cwd-prefix project matching now treat+ Windows drive-letter and UNC paths as case-insensitive. A Linux server+ (the Docker Desktop helper) comparing host cwds from Explorer, Git, and+ PowerShell previously required a byte-exact match, so `C:\Users\…\repo`+ vs `c:\users\…\repo` missed the pending auto-handoff and could mint a+ fragment project. Unix paths stay case-sensitive. (#806)+ - Fixed `Ctrl+C` at the native-session chooser leaving the launcher alive and+ renewing its workstream lease. Cancelling now releases the acquired run and+ exits without waiting for Enter or linking a native session (#795).+ - The privacy strip now redacts Windows credential paths (`C:\Users\…\.ssh`,+ `.aws`, `.kube`, `.gnupg`, `.config\gcloud`). The previous patterns required+ a POSIX `/` separator, so a captured tool result that echoed a native+ Windows path stored the profile directory and key file name verbatim. (#805)+ - The privacy strip now redacts secrets written in JSON. The quote before a+ value put it outside the value character class, so `{"db_password":"..."}`+ was stored verbatim while the identical YAML form was redacted, and JSON is+ the shape most captured tool payloads arrive in. The same rule now also+ accepts an auth scheme word before the value, so+ `Authorization: Basic <base64>` (which carries `user:password`) is redacted+ like the `Bearer` form already was, and covers two unprefixed names the+ generic env rule missed: Azure `AccountKey=` and npm `_authToken=`. (#800)+ - Terminal escape sequences, NUL and bidi override characters are stripped+ from captured text instead of being stored. Page bodies and observations are+ replayed to a terminal by `ai-memory read-page` and `ai-memory search`, where+ an escape rewrites the screen or the window title and a bidi override+ reverses what the reader sees; a NUL additionally made the markdown file+ binary, costing it `grep` and git diffs. Tabs, newlines and carriage returns+ are kept. (#800)+ - A page write is refused when another live page in the same project differs+ from it only by case or Unicode normalization. Such a pair is one file on+ macOS (APFS) and Windows (NTFS), so creating the second silently overwrote+ the first page's file while the index kept both rows, so reads for either path+ then returned the survivor's body, and the wiki watcher superseded the+ overwritten row, losing the original content from disk and index alike. The+ refusal names both paths, applies on every platform (the wiki is synced+ between them), and leaves supersedes of an existing path untouched.+ `reindex` skips such a pair instead of failing the whole rebuild, reports the+ count, and logs each one. (#799)+## [2.3.2] - 2026-09-20### Changed