Skip to content

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

Rust

Merge PR #1243: fix(hooks): queue PreCompact LLM work on the durable worker (#1229)

AkitaOnRailsad1ff4331dd1
diff --cc CHANGELOG.md
index d862805d,4d7118b7..e5ff531b
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -8,25 -8,19 +8,38 @@@ and this project adheres to [Semantic V
## [Unreleased]
### Fixed
+- Fixed `ai-memory list-projects` failing with `404 Not Found` against a
+ server started without `--enable-web` or `--enable-api`, the routes that
+ mount `GET /api/v1/projects`. On a 404 it now reads the always-mounted
+ `GET /admin/projects` and applies `--workspace` itself; `ai-memory show`
+ lists projects the same way instead of falling back to local scan results.
+ If both calls fail, the error names both routes and the likely causes.
+ (#1236)
+- Fixed consolidation sending the model a prompt with no evidence when
+ `consolidation.max_input_tokens` sat at the validated floor. The floor was
+ checked against the raw token count, but the prompt builders work on a
+ smaller character budget (tokens × a chars-per-token estimate ×
+ `input_token_safety_margin`, default 0.8). At the old 6,500 floor the batch
+ prompt's fixed part alone overflowed that budget, so every observation became
+ an omission marker. The floor is now 8,350 tokens at the default margin, and
+ a lower margin needs a proportionally larger budget. A project's existing
+ page titles are now optional prompt context, listed only as far as they fit,
+ so a project with many pages no longer crowds observations out at a small
+ budget. An install configured between 6,500 and 8,350 tokens now fails at
+ startup with a message naming both numbers. (#1234, #1242)
+ - Fixed PreCompact and PostCompaction waiting for the LLM provider inside
+ `/hook` and `/hook/batch`. That 12-135 s call outlived the client's drain
+ timeout, left the ingest key incomplete and restarted on every redelivery.
+ The request now writes the rule-based `sessions/<id>.md` checkpoint and
+ returns; with a provider, the LLM rewrite is queued for the bounded worker
+ SessionEnd already uses, which now starts whenever a provider is configured
+ and runs each job as the session's recorded owner. A resumed session's
+ checkpoint queues its rewrite too, and a retried checkpoint never puts the
+ rule-based page back over a finished rewrite. Two side effects: SessionEnd
+ jobs queued while `AI_MEMORY_CONSOLIDATE_ON_SESSION_END` was on now run even
+ if the flag has since been turned off, and without the flag a session that
+ ends while its checkpoint rewrite runs keeps that rewrite as the latest page,
+ with the SessionEnd summary as the superseded version. (#1229, #1243)
- Replaced the unmaintained YAML library (`serde_yaml` and its
`unsafe-libyaml` parser, RUSTSEC-2024-0449) with `serde-saphyr`. The server
reads existing page frontmatter to exactly the same values as before. One