Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge pull request #1898 from gb/fix/wikisync-lock-fork-race
AkitaOnRailsea46dca808ea
diff --cc CHANGELOG.mdindex 23b0fd16,c400afcc..ea7d4c7c--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -13,42 -13,12 +13,48 @@@ version in [`docs/changelog/`](docs/cha### Fixed+ - `ai-memory-wikisync` no longer refuses a destination as "already being+ modified" right after its own run released it. On Unix a child forked by+ another thread inherits the lock until it calls `exec`, so the next run+ could see it still held; the acquire now retries for about half a second.+ A real concurrent run is still refused. This failed the companion's CI+ suite about one run in five (#1897).+- `ai-memory upgrade` on Windows now waits for a scanner to release the+ running or the freshly written binary before swapping them, instead of+ failing with "being used by another process". The swap retries that+ sharing violation for about eight seconds, as the wiki's atomic writes+ already did (#1895).+- Captured Claude Code tool failures. Claude Code fires `PostToolUseFailure`,+ not `PostToolUse`, when a tool fails, and ai-memory never wired that event+ for Claude Code, so failed commands, builds and test runs never reached+ capture, search, consolidation or the handoff. `install-hooks --agent+ claude-code`, `setup` and the marketplace plugin now wire it to the+ post-tool-use handler; the observation records `outcome: error` with the+ bounded error text (never the tool's arguments); the session page counts+ failed calls and quotes the newest one; the automatic handoff adds a `Last+ failed tool call` line; and the plugin no longer drops a failure when+ settings hooks wire only the success event. Re-run `ai-memory install-hooks+ --agent claude-code --apply` (or `ai-memory setup`) on an existing install.+ Grok Build CLI keeps its nine events (#1893).+- `bootstrap` now waits for a provider's `Retry-After` before retrying a+ chunk, capped at 32 s like the remote embedders (#1397). It retried after a+ fixed 2 s and gave up after three attempts, so a rate-limited hosted API+ (DeepSeek, OpenAI) failed the run while it was still asking the client to+ wait. Without a hint the fixed 2 s delay is unchanged (#1889).+- `GET /handoff` (the `session-start` hook) returns again on large projects.+ On a store without planner statistics, the unfinished-session recovery+ lookup walked every observation in the project and rescanned the project for+ each one, so the request never returned and left a server thread spinning.+ It now checks each of the project's sessions once through+ `idx_observations_session` and reads the project's handoffs once (#1879).+- A 2.x project is now adopted whichever checkout of its repository captures+ first. When a linked worktree (`git worktree add`) captured before the main+ checkout, the repository identity created a new project, every checkout then+ followed the identity there, and the 2.x project with its pages and sessions+ was orphaned. A worktree now claims the identity-less project named after its+ main checkout, as the main checkout would. The server reads the worktree's+ git metadata to find it; `docs/upgrading-to-3.0.md` covers a server that+ cannot read the checkout (#1880).- Project search links now use the project's current stored name afterresolving a canonical or legacy key. Results, breadcrumbs, and the scopeselector stay on that project without renaming it (#1875).