Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge PR #1127: feat: add a Cursor Agent CLI LLM provider
AkitaOnRails271b823b29ff
diff --cc CHANGELOG.mdindex b8a298e0,695f3c51..e0139a9d--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -40,81 -25,8 +40,86 @@@ and this project adheres to [Semantic Vre-running `backfill --force` over sessions imported by ai-memory ≤2.6.0 (orplain-backfilling a recovery-replayed session) can duplicate those olderobservations. (#1125)+- Added `AI_MEMORY_LLM_COMPAT_DISABLE_THINKING` for the `openai-compat`+ provider (opt-in, off by default, ignored by every other provider): when+ set, every chat request carries+ `chat_template_kwargs: {"enable_thinking": false}`, so thinking-capable+ local engines (vLLM / SGLang serving Qwen3-class models) spend the output+ budget on the structured payload instead of a reasoning pass. (#1130)++- Added the `cursor` LLM provider. Consolidation calls the logged-in Cursor++ Agent CLI (`agent --print --mode ask`) so a Cursor subscription can drive++ summaries without an API key. The default model is `cursor-grok-4.6-high`++ ("Grok 4.6"). `AI_MEMORY_CURSOR_AGENT` overrides the binary. The provider never passes++ `--yolo` or `--force`, because the prompt is captured session text. (#1127)### Fixed+- Fixed the cross-project profile rewriting a settled entry whenever new+ evidence merely agreed with it: a statement now changes only when the ruling+ or its scope does (the LLM merge reports `changed`), so the line every project+ receives stays put. The profile digest also moved to the front of the+ session-start payload, ahead of the handoff and brief that change every+ session, so it stays in the harness's cacheable prompt prefix; its footer now+ asks the agent to open an entry before relying on its one-line summary; and+ topic grouping no longer compares every candidate with every other, which+ grew quadratically on long-lived installs. See+ `docs/design-cross-project-profile.md` §11. (#1000)+- Fixed the scheduled auto-improve tests' intermittent empty log captures+ (the same latent flaw #1116 fixed for the hooks checkpoint test): a shared+ `warn!` callsite's first-in-process execution on a bare thread caches+ `Interest::never()`, after which no per-test `set_default` capture ever+ sees the event under single-process harnesses (libtest, Windows CI). The+ tick outcome now carries the typed `failure_summaries` and+ `skipped_proposals` the warnings mirror, and the tests assert those+ instead of a captured log stream. Logged messages and levels are+ unchanged. (#1118)+- Fixed hook observation bodies being capped *before* the sanitizer ever saw+ them: excerpt extraction (`tool: …` bodies, user prompts, notifications,+ post-compaction summaries, extension bodies) applied its 2 KB / 16 KB+ ceilings at parse time, so a secret straddling the cutoff was cut in half+ and the surviving prefix, too short to match a pattern, was stored+ unredacted — the body-side twin of the #980 title-hint leak. The per-event+ caps (`payload::durable_body_cap`) now run at the ingest funnel, applied to+ the already-scrubbed text, mirroring `Sanitized::new` and the #1109+ feedback-reason fix. The stored body shapes and byte limits are unchanged.+ (#1114)+- Fixed the native hook's client-side spool cap truncating oversized+ lifecycle bodies (user prompts, notifications, post-compaction summaries)+ before any scrubbing: the capped field is now scrubbed with the built-in+ sanitizer first and truncated second — the order `assistant_capture` and+ the #980 / #1109 fixes established — so a straddling secret can no longer+ reach the spool (and through it the server) as an unredacted fragment.+ (#1114)+- Fixed the managed-workstream ledger capping event content *before* the+ sanitizer ever saw it: the 64 KiB per-event cap in+ `hooks::workstream::sanitize_events` truncated first, so a secret+ straddling the cutoff was cut into a prefix too short to match any+ pattern and persisted unredacted in the immutable raw segment — the same+ ordering bug as the #980 title-hint and #1109 feedback-reason leaks. The+ cap now runs after scrubbing, the server-generated checkpoint and losses+ boundary events get the same ordering, and the store's `finish_run`+ scrubs with the caller's sanitizer before its own 16 KiB bound as+ defense in depth. The stored shapes and byte limits are unchanged.+ (#1113)+- Fixed SessionEnd replacing the session page an agent wrote itself through+ `memory_write_page` with `session_id`: the rule-based summary overwrote it+ on every substantive session end, and the opt-in SessionEnd worker's skip+ never applied, since it read the page after that overwrite and compared an+ observation count that the agent's own tool call, the Stop and the+ SessionEnd always advance. A session page carrying `consolidated_by: agent`+ is now kept by both, and by the PreCompact and PostCompaction checkpoints,+ which rewrote it the same way. The write no longer stamps+ `observation_generation`. (#1138)+- Fixed `ai-memory run claude` resuming the launch session forever after a+ `/clear`: Claude Code continues a cleared conversation in a new session,+ and the workstream now follows it — the newest one after several clears —+ so the next launch resumes where the work actually went and that+ transcript, not the abandoned one, is imported. Only a transcript that+ records the `/clear` command, names this launch's session as its origin,+ and stays in this checkout (or a directory below it) is followed. (#1135)+- Fixed `ai-memory backfill` failing on every Antigravity CLI session: it and+ `ai-memory run` now import the session's user prompts from `agy`'s+ `history.jsonl`, keeping only lines whose conversation and workspace match+ the checkout. (#1134)- Fixed the hook spool charging a spooled event's retry budget while theserver was unreachable: an endpoint-level delivery failure (connectionrefused, timeout, DNS — the existing `Unreachable` classification) no