Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Rewrite the changelog entry for the recovered serve and owner remember fixes

garrytan19bdd7b4ffd4
diff --git a/changelog.d/capy-recovered-serve-sync-and-owner-remember.md b/changelog.d/capy-recovered-serve-sync-and-owner-remember.md
index adf2574228..20b0011f5f 100644
--- a/changelog.d/capy-recovered-serve-sync-and-owner-remember.md
+++ b/changelog.d/capy-recovered-serve-sync-and-owner-remember.md
@@ -1,10 +1,9 @@
-### A recovered `gbrain serve` syncs again, and the brain owner's `remember` works on a large page
+**A `gbrain serve` that recovers from status-only mode can sync again, and the brain owner's `remember` works on an entity page stored in segments.**
-**Syncs no longer fail after a `gbrain serve` recovers from status-only mode (#9224).** When `gbrain serve` starts while another gbrain process holds a PGLite brain (a second agent session, or a cron job), it answers with only `gbrain_status` until the brain opens, then takes over as the brain's owner. From then on, every `gbrain sync` handed to that owner that had pages to write failed with `storage_error` "The persistence owner could not complete this request", and the owner's own `sync_brain` failed with "Unknown engine kind for db-lock: pglite". This lasted until the agent session restarted. An ordinary install, where serve opens the brain when it starts, was not affected.
-- The cause was in the stand-in engine that status-only serve runs on. On recovery it passed the live engine's methods through, but not its getters and fields, so PGLite's `db` handle was missing and the sync lock could not be taken. It also wrapped every method as `async`, so a synchronous method such as `registerBeforeDisconnect` returned a promise instead of its value, which broke a sync that got past the lock. After recovery the stand-in now exposes exactly the live engine's properties, read through to it, and a synchronous method returns its own value. A Postgres `gbrain serve` that started while its database was unreachable runs on the same stand-in and gets the same fix; its sync lock was never affected.
-- An unexpected fault inside the owner now reaches the caller as `internal_error` (detail `owner_internal`) with an incident ID. The error says the request was not at fault, and that restarting that owner and rerunning the command recovers; with no owner running, the CLI opens the brain itself. A write also names its request ID to inspect first. The fix, `gbrain sources writer status --json`, is read-only and names the owner process. The owner's own stderr records the error class and the gbrain code location under the same incident ID, with connection strings redacted, and nothing about the cause crosses the local socket. Before, the caller got `storage_error` and a `gbrain doctor` fix that could not see the fault, and the owner logged nothing.
-
-**The brain owner's `remember` works on an entity page stored in segments (#9213).** With a token bound to the brain owner, `remember` onto a large entity page (one stored in segments) was refused with `page_body_segmented` before it was admitted, while the same call from an unbound token committed. The owner's visibility checks copied the whole page object, and reading a segmented page's body as one string throws on purpose. Those checks now read only the page's labels, readers and identity. The same mistake is fixed in the member scope-page check, at admission and at preparation, and in the shared-origin retention purge of a page over 24 MiB. The guard that refuses whole-body reads of a segmented page is exactly as strict as before.
-- A write refused with `page_body_segmented` no longer suggests `get_page body: "auto"`, which reads the page and doesn't help a write. A `remember` gets the fix that works, which is to save the claim without an entity, filed under `memory/unattributed`. Any other write over MCP gets a fix with no step to run that names the edits that do work on such a page: `edit_page`, `append_page`, `add_tag` and `remove_tag`. Reads keep the `get_page` fix.
+### Fixed
+- **Syncs after a recovered `gbrain serve` (#9224).** When `gbrain serve` starts while another gbrain process holds a PGLite brain (a second agent session or a cron job), it answers only `gbrain_status` until the brain opens, then becomes the brain's owner. After that, every `gbrain sync` handed to it that had pages to write failed with `storage_error`, and its own `sync_brain` failed with "Unknown engine kind for db-lock: pglite", until the agent session restarted. Those syncs now commit. The stand-in engine that status-only serve runs on now passes through every property of the live engine, not only its methods, and a synchronous method returns its own value instead of a promise. A Postgres `gbrain serve` that started while its database was unreachable gets the same fix. A serve that opens the brain when it starts was never affected.
+- **A clear error when the owner itself faults (#9224).** An unexpected fault inside the process that owns the brain now reaches the caller as `internal_error` (detail `owner_internal`) with an incident ID, instead of a `storage_error` whose `gbrain doctor` fix could not see the fault. The error says the request was not at fault and that restarting the owner and rerunning the command recovers; a write also names its request ID to check first with `gbrain write-request`. Its fix, `gbrain sources writer status --json`, is read-only and names the owner process. The owner's stderr records the error class, the gbrain code location and the database error text under the same incident ID, with connection strings redacted, and none of it crosses the local socket.
+- **The owner's `remember` on a large entity page (#9213).** With a token bound to the brain owner, `remember` onto an entity page stored in segments was refused with `page_body_segmented`, while the same call from an unbound token committed. It now commits. The owner's visibility checks no longer read the page body, which on such a page cannot be read as one string. The member scope-page check and the shared-origin retention purge of a page over 24 MiB had the same mistake and are fixed too. The guard that refuses whole-body reads of a segmented page is as strict as before.
+- **Better advice when a write is refused on a page stored in segments.** The refusal no longer suggests `get_page body: "auto"`, which only reads the page. `remember` is told to save the claim without an entity (it is filed under `memory/unattributed`), and any other write over MCP names the edits that work on such a page: `edit_page`, `append_page`, `add_tag` and `remove_tag`.
Reported by @thiagodalvarenga (#9224) and @andreineacsu (#9213). First fixed by @Masashi-Ono0611 (#9231, #9215).