Skip to content

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

Rust

Merge branch 'fix/global-scope-write-authz' (GHSA-7qj3-7wqw-m5w6)

AkitaOnRailsd1424ee85c6a
diff --cc CHANGELOG.md
index f96fdd7f,2451b975..2269e13b
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -11,17 -11,16 +11,26 @@@ and this project adheres to [Semantic V
- Documented FutureInfra as an endpoint for the existing `openai-compat`
provider. (#1026)
+ ### Security
+ - Fixed GHSA-7qj3-7wqw-m5w6: in multi-user mode a database user without a
+ write grant on the reserved global preferences scope (`default/_global`)
+ could write it, and its pages are unioned into every user's queries,
+ including restricted projects. Writing it now needs root or an explicit
+ `write` grant on `_global`, whichever way the scope is named; creating it
+ grants nothing, reads stay open, and installs without database users are
+ unchanged. Reported by @Josehbr.
+
### Fixed
+- Fixed the generated OpenCode 2 plugin ending every tracked session when
+ OpenCode unloads it on idle-location eviction. Unload is not shutdown: the
+ host and its sessions stay alive, so each eviction froze a live session
+ (`SessionStart` cannot reopen an ended OpenCode session), fabricated a
+ spurious summary page and open handoff, and made the next baton fetch fail
+ with `invalid state: an ended session cannot accept a handoff`. Plugin
+ unload no longer posts `session-end`; deletion (`session.deleted`) remains
+ the end signal and a completed root turn already publishes its continuation
+ checkpoint and baton. Regenerate the plugin with
+ `ai-memory install-hooks --agent opencode2 --apply`. (#1074)
- Fixed watcher reindexing racing with writes and batches to the same page by
sharing their per-page mutex from disk read through SQLite upsert. Both
mutation guards are released before embedding; external editors remain
diff --cc docs/cookbook.md
index 054df022,05dad40f..6e66f17a
--- a/docs/cookbook.md
+++ b/docs/cookbook.md
@@@ -42,11 -42,8 +42,12 @@@ Your agent calls `memory_write_page` an
under `_rules/` when it's a rule). Next session, `memory_query` surfaces it, and
if the project's `.ai-memory.toml` opts into the on-start brief, rules are
prepended to the agent's context automatically. To make it apply to **all** your
- projects, ask for it as a global rule (`scope: "global"`). From another
- project's page, link to that standing page with `[[_global:path]]` — it always
- names the reserved `_global` project in the default workspace. Sibling projects
- use `[[project:path]]`; another workspace uses `[[workspace/project:path]]`.
- Bare `[[name]]` stays inside the current project.
+ projects, ask for it as a global rule (`scope: "global"`). On a multi-user
-server, writing a global rule needs root or a `write` grant on `_global`.
++server, writing a global rule needs root or a `write` grant on `_global`. From
++another project's page, link to that standing page with `[[_global:path]]` — it
++always names the reserved `_global` project in the default workspace. Sibling
++projects use `[[project:path]]`; another workspace uses
++`[[workspace/project:path]]`. Bare `[[name]]` stays inside the current project.
## Recipe: have a project read a specific document before implementing