Skip to content

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

Rust

Merge PR #658: bound the whole session brief by max_chars (#657)

AkitaOnRailsa8435820950b
diff --cc CHANGELOG.md
index cc834fdf,d2dcc613..8783abee
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -24,12 -31,21 +31,27 @@@ and this project adheres to [Semantic V
28s to 19s on a 32-thread Windows box.
### Fixed
+- Fixed `purge-session` leaving the live `sessions/<id>.md` wiki file behind
+ after deleting the session's SQLite rows. The admin endpoint now removes the
+ scoped page file after the DB purge commits, reports actual cleanup through
+ `files_deleted` / `files_failed`, and marks `purge_session` observer webhooks
+ with `partial_failure: true` when file cleanup fails, so a later wiki reindex
+ cannot resurrect the purged session. (#653)
+ - `[briefing] max_chars` is now the size of the brief the agent actually
+ receives. Page bodies were budgeted, but every section rendered *after*
+ them escaped the accounting: the truncation notice, the crowded-out core
+ page list, the recently-updated pointers, the closing untrusted-history
+ fence and the agent footer. The escape pass that neutralises an untrusted
+ `<!-- ai-memory:untrusted-history -->` marker inside a page body then
+ lengthened the text by a further 6 chars per marker, after the count. A
+ 4000-char budget rendered 6577 chars, and the 500-char floor rendered
+ 3054 — six times what the operator asked for, on every opted-in session
+ start. Bodies are now served first, the pointer sections are sized
+ against what the bodies left (the omitted list degrading to a bare count
+ when not even the paths fit), and the mandatory scaffold is reserved
+ before a single body char is spent. The regression test asserting this
+ was named `render_session_brief_enforces_budget` but only checked the
+ brief's contents, never its length. (#657)
- Authentication-disabled HTTP servers now ignore stale or unexpected Bearer
headers and preserve anonymous access. Previously, a client retaining an old
`AI_MEMORY_AUTH_TOKEN` received `401 Unauthorized` even though the server