Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/master' into capy/pglite-analyze-replan
garrytan9fb695e4ade7
diff --cc CHANGELOG.mdindex d50e3438af,03d7842d8a..df5ca77c64--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,14 -10,14 +10,22 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased]++**A long-running PGLite process picks up fresh planner statistics instead of keeping the plans it made before them.** PGLite has no autovacuum, so a freshly imported brain has no statistics until planner-stats' first-read refresh runs `ANALYZE`. But gbrain's PGLite statement cache keeps named prepared statements, and PostgreSQL keeps a prepared statement's plan across `ANALYZE`, so every statement prepared before the refresh kept its no-statistics plan for the life of the process (a `gbrain serve`, an agent session, a script). On a 55,838-page brain imported without statistics, `entity names` with 50 names stayed at 3.4 to 3.7 s for every call after the refresh. With this fix the calls after the first take 1.2 to 1.5 s, the same as a freshly started process.++### Itemized changes++- **`ANALYZE` and `VACUUM` clear the PGLite statement cache** (`src/core/pglite-statements.ts`), like DDL already did, so the next call re-prepares and plans with the new statistics. This covers planner-stats' refreshes, `gbrain repair planner-stats`, projection statistics and the persistence journal's `VACUUM (ANALYZE)`. Postgres is unchanged. `test/pglite-statements.test.ts` checks that a statement prepared before `ANALYZE` is re-prepared after it; the check fails without the fix.++ ## [0.60.196.0] - 2026-10-13++ ### Itemized changes++ - **Flake fix: `test/write-contract-conformance.test.ts` (and its Postgres arm) no longer fails with `ECONNRESET` on a loaded CI shard.** The conformance HTTP clients connected before the stdio arm and reused a pooled keep-alive socket afterwards; when the stdio arm outlived the test server's 10 s idle timeout (`Bun.serve` default in the test-only `startHttpTransport`, swept every 4 s; production `serve --http` is Express and advertises `Keep-Alive: timeout=5`), the first HTTP POST could land in the sweep that closed the socket, and Bun's fetch, which parks pooled sockets for 5 minutes, parses no `Keep-Alive` hint and never retries a POST, surfaced "The socket connection was closed unexpectedly". The clients now send `Connection: close`, so each call uses its own socket. Forced probe (test server `idleTimeout: 1`, a 4.1 s busy loop across one sweep, then a POST): 3/3 ECONNRESET before, 3/3 pass after, both engines. No assertion or timeout changed. Sixteen other tests share the same test server with persistent MCP HTTP clients and carry the same exposure if a case idles a client 10 s before a POST; a Bun-based thin client (`src/commands/protocol.ts`, `src/core/connect-probe.ts`) has the same narrow window against the production server past 5 s idle (follow-up, not changed here).+ - **Flake fix: `test/e2e/worker-configuration-release.test.ts` cleanup accepts `ESRCH` from `/proc/<pid>/stat`.** The "completion-recording failure never releases an isolated handler with a live descendant" case passed every assertion and then threw in its `finally` wait loop: right after the SIGKILL, Linux reaps the descendant between the loop's `open()` and `read()` of its stat file and returns `ESRCH` instead of `ENOENT` (#6575, job 115084475795). The catch now treats both as "gone"; the `running` must-end-false assertion is unchanged. Forced probe (a `bun test --preload` that makes the test's first stat read throw `ESRCH`): 3/3 fail before, 3/3 pass after; unforced 4/4.+ - The `[0.60.189.0]` entry names migrations v241 and v242, the numbers it merged with (the merge-slot renumber from v240/v241 updated the stamps, not the entry text).+## [0.60.195.0] - 2026-10-13**CI and the release build move to Bun 1.4.3, which carries the fix for the spawnSync hang that poisoned whole test shards (#6586).** On Bun 1.4.0 to 1.4.2, a garbage-collection finalizer that runs while `Bun.spawnSync` waits can leave the runtime's private spawnSync loop miscounted for the rest of the process (oven-sh/bun#34069). After that, a synchronous child spawn may never notice its child exit. A spawn with a timeout comes back `ETIMEDOUT` even though the child finished, and one without a timeout spins until the test deadline kills it. Run 38335527492 hit this twice: `test (2)` hung in `test/managed-sync-pinned-reads.test.ts` and was cancelled, while the identical code on the identical file order passed on master and on #6576. Bun 1.4.3 (released 2026-10-10) contains upstream commit 13a98b0. `compare/bun-v1.4.3...13a98b0` reports `behind`, which means the release already has the commit. The supported install floor stays at Bun 1.4.0.