Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

Merge PR #1291: fix(hooks): launch one backfill per checkout, not one per session (#1287)

AkitaOnRails10d90f5ea459
diff --cc CHANGELOG.md
index 79c07f4a,1db53bc5..0c4cb7fa
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -12,30 -12,14 +12,31 @@@ version in [`docs/changelog/`](docs/cha
## [Unreleased]
### Fixed
+- Fixed the thin-client commands ignoring a custom `bind`, which could write
+ into the wrong store. `server_url` defaulted to `http://127.0.0.1:49374`
+ and was never derived from `bind`, so `ai-memory --data-dir X status` (and
+ `write-page`, `search`, `purge-project`, ...) called the default port
+ whatever `bind` said. With nothing listening there the command failed; with
+ another server listening there it operated on that server's data, and one
+ reporter wrote test pages into their real store this way. When neither
+ `config.toml` nor `AI_MEMORY_SERVER_URL` sets `server_url`, it is now
+ derived from `bind`: an unspecified address maps to loopback (`0.0.0.0` to
+ `127.0.0.1`, `[::]` to `[::1]`) and any other host is used as given,
+ hostname included. An explicit value in the file or the environment still
+ wins, even when it names the default URL; a `bind` that is not a
+ `host:port`, or one on port 0, leaves the default URL alone; and the default
+ `bind` resolves to the same URL as before, so an install that never changed
+ either key is unaffected. `install-hooks` and `install-mcp` still prefer an
+ existing MCP entry's URL, and otherwise write the derived URL instead of the
+ default port. (#1269)
- ||||||| 705aba70
- - Fixed `ai-memory run --yolo` failing with `401 Unauthorized` after it
- re-ran itself under ai-jail on an install whose bearer token lives in
- `[auth].bearer_token_file`. ai-jail's private home hides the data dir, so
- the jailed run had no token. The outer run now passes the token it resolved,
- and a `server_url` set in `config.toml`, into the jail through the
- environment, never the command line. (#1284)
+ - Fixed a burst of sessions in a directory with no backfill marker launching
+ one `backfill --auto` per session. The SessionStart hook now takes an
+ atomic in-progress marker before it spawns the backfill, so concurrent
+ sessions in that directory start one; the marker is dropped when the worker
+ ends and a leftover one stops blocking after 30 minutes. The backfill's
+ emptiness check against the server also gives up after 30 seconds instead
+ of waiting forever on a saturated server. Keying the trigger on the project
+ rather than the directory is not part of this change. (#1287)
- Fixed Windows capture dropping the body of file and shell tool events
the client had kept. With `[capture] ignore_paths` active, server
re-inspection compiled a POSIX never-match sentinel and treated the