Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chore(release): unstamp onto master v0.60.707.0; versions are written at release
garrytan59d9a1bc05cd
diff --git a/changelog.d/capy-recovered-serve-sync-and-owner-remember.md b/changelog.d/capy-recovered-serve-sync-and-owner-remember.mdnew file mode 100644index 0000000000..adf2574228--- /dev/null+++ b/changelog.d/capy-recovered-serve-sync-and-owner-remember.md@@ -0,0 +1,10 @@+### A recovered `gbrain serve` syncs again, and the brain owner's `remember` works on a large page++**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.++Reported by @thiagodalvarenga (#9224) and @andreineacsu (#9213). First fixed by @Masashi-Ono0611 (#9231, #9215).