Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge origin/master (77cf8e111, v0.60.169.0, #6447) into capy/w14-openclaw-ready-reader; restamp 0.60.170.0

garrytand9200edfb4a9
diff --cc .claude-plugin/plugin.json
index 8791130e0c,8791130e0c..b6163ef819
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc .codex-plugin/plugin.json
index aa3912aa9b,aa3912aa9b..6bcaeb9402
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc BOOTSTRAP_FOR_AGENTS.md
index a6222d2bcb,a6222d2bcb..fe8a904073
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-runbook-stamp: 0.60.169.0 -->
++<!-- gbrain-runbook-stamp: 0.60.170.0 -->
<!-- This stamp must equal the VERSION file at every release; CI enforces it
(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it to
the installed binary and warns on skew. -->
diff --cc CHANGELOG.md
index d56a6dd6b3,88e1fcc709..163e38368b
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,15 -10,29 +10,38 @@@ credits are retained; no result has bee
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
- ## [0.60.169.0] - 2026-10-11
++## [0.60.170.0] - 2026-10-11
+
+**Fixes the OpenClaw native startup lane that failed master three times; no product change.**
+
+### Itemized changes
+
+- `test/openclaw-context-engine-native.serial.test.ts` lost gateway output: it raced `reader.read()` against a one-second timer, and a read the timer beat stayed queued on the reader, so the next chunk the gateway wrote (after a quiet second of plugin loading, `[gateway] ready` itself) resolved that abandoned read and was dropped. The test now drains stdout and stderr with one pump per stream from spawn (`test/helpers/stream-text.ts`) and polls the collected text; `test/stream-text.test.ts` pins both the pump and the losing pattern with a child that is silent for 1.5 s before its ready line. The startup window is unchanged at 60 s.
+- The same test's gateway config sets `update.checkOnStart: false` and `models.catalogRefresh.enabled: false`, so the pinned gateway makes no request to `telemetry.openclaw.ai` or `catalog.openclaw.ai` at startup (verified under `strace`: no outbound connect); the test asserts neither notice appears.
+
+ ## [0.60.169.0] - 2026-10-11
+
+ **`recall` can rank saved facts by a question.** Pass `question` and recall returns the facts most relevant to it, each with a `relevance` score, instead of the newest ones. Facts below the match threshold are left out, so an empty list means nothing saved matches.
+
+ Calls without `question` behave as before and return the newest facts; every response now says which order it used in `facts_order`. A call that passes only `query` carries a `recall_hint` notice naming `question` and the exact retry call. `gbrain recall --question "<q>"` works from the CLI, locally or against a remote brain. Ranking uses the same read policy as every other recall: the trust floor, quarantine and rederive hiding, remote world-only facts and the private-page filter all apply. Restart a resident `gbrain serve` after upgrading so agents see the new parameter.
+
+ ## To take advantage of v0.60.169.0
+
+ `gbrain upgrade` applies the facts index migration (v237) automatically. If `gbrain doctor` warns about a partial migration, run `gbrain apply-migrations --yes`, then restart a resident `gbrain serve`.
+
+ ### Itemized changes
+
+ - **`recall` `question`** (`facts/question-recall.ts`, `ops/facts.ts`). Up to 2,000 characters; refused with `supersessions` or `include_expired`, with the corrected call in the error. Works with `entity`, `session_id`, `since`, `grep` and every other fact filter, which apply before ranking. The question is embedded once through the gateway's query-embedding cache, so a `query` of the same text in the same process costs no second provider call. Without an embedding provider, or with embeddings turned off, facts rank by word match and `facts_degraded.reason` says so; facts without an embedding are counted in `facts_degraded.unembedded`, with a `facts_unembedded` notice whose fix previews `gbrain embed --stale --facts` before any paid run.
+ - **Admission rule** (`recall.question_admission`). `reserve` (default) keeps a fact at cosine 0.5 or a third of the question's words; `facts_arm` uses the stricter facts-arm rule.
+ - **Shared fact scorer** (`search/fact-relevance.ts`). Recall's `question`, the temporal fact reserve and the facts arm now read one candidate pool and one scorer. Word matches are whole-word, and a very long fact's matches count for less. In `query`, facts of an entity the question names come only from that entity page's own source.
+ - **`gbrain recall --question`** reads its value as the question; before, it was taken as an entity name.
+ - **Fast on large brains.** On a 100k-fact brain a ranked recall takes 51 ms at p95 on Postgres (65 ms for a remote caller, 10 ms with `entity`) and 152 ms on PGLite (139 ms remote, 54 ms with `entity`). The facts index migration (v237) adds a keyword index over active facts (built under `GBRAIN_FTS_LANGUAGE`; `gbrain reindex-search-vector` replaces it when the language changes) and two small indexes for the unembedded count. On Postgres every index is built `CONCURRENTLY`, so writes to facts never wait on the build, and the keyword index is built under a temporary name and renamed into place, so search keeps an index throughout; an interrupted migration or reindex finishes on its next run. The vector, keyword and entity lookups run concurrently, the vector lookup now uses the facts HNSW index, and the keyword lookup is planned per call. Building the indexes reads each fact once (about 2 seconds per 100k facts) and rewrites none.
+ - **Embedding model switches keep fact indexes.** A dimension change rebuilds `facts.embedding` and now re-creates the btree indexes that read it instead of dropping them.
+
+ ### For contributors
+
+ - `test/recall-question.test.ts` covers ranking, the parameter contract, the read policy (local, remote and private-sourced facts), the degraded paths, `recall_hint` and the embedding cache on PGLite, and on Postgres through `test/e2e/recall-question-postgres.test.ts`. `test/fact-relevance.test.ts` pins the scorer; `test/recall-question-cli.test.ts` the CLI.
+
## [0.60.168.0] - 2026-10-11
**Fix wave 14, part 1: the big-brain memory blowups stop, a renamed page keeps its history, and `gbrain init` tells you who is blocking it instead of hanging.**
diff --cc VERSION
index 03ff1a7028,03ff1a7028..27d852f2cf
--- a/VERSION
+++ b/VERSION
@@@ -1,1 -1,1 +1,1 @@@
--0.60.169.0
++0.60.170.0
diff --cc openclaw.plugin.json
index f479387e69,f479387e69..6fe3df52ce
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@@ -1,7 -1,7 +1,7 @@@
{
"id": "gbrain-context-engine",
"name": "gbrain",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Personal knowledge brain with Postgres + pgvector hybrid search",
"family": "bundle-plugin",
"kind": "context-engine",
diff --cc package.json
index c859096f03,c859096f03..3282ff3040
--- a/package.json
+++ b/package.json
@@@ -232,7 -232,7 +232,7 @@@
"bun": ">=1.4.0"
},
"license": "MIT",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"overrides": {
"@ai-sdk/provider-utils": "4.0.56",
"@hono/node-server": "^2.0.5",
diff --cc plugin-variants/gbrain-coding/.claude-plugin/plugin.json
index af6be47ed7,af6be47ed7..e7b4978566
--- a/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/.codex-plugin/plugin.json
index ad173bee00,ad173bee00..806c1b0682
--- a/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/README.md
index 8028f61a51,8028f61a51..b769874af6
--- a/plugin-variants/gbrain-coding/README.md
+++ b/plugin-variants/gbrain-coding/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.169.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.170.0 -->
# gbrain-coding (generated persona variant — do not hand-edit)
Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant.
diff --cc plugin-variants/gbrain-daily/.claude-plugin/plugin.json
index d16d938217,d16d938217..fd4bdf46a5
--- a/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/.codex-plugin/plugin.json
index 8320d6faee,8320d6faee..081745047d
--- a/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
-- "version": "0.60.169.0",
++ "version": "0.60.170.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/README.md
index cdd2c3ad21,cdd2c3ad21..33ec46d0d6
--- a/plugin-variants/gbrain-daily/README.md
+++ b/plugin-variants/gbrain-daily/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.169.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.170.0 -->
# gbrain-daily (generated persona variant — do not hand-edit)
Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant.
diff --cc plugin/README.md
index 49f58b2e1b,49f58b2e1b..a2963cbad5
--- a/plugin/README.md
+++ b/plugin/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.169.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.170.0 -->
# gbrain plugin skill tree (generated — do not hand-edit)
This tree is the curated skill set for the gbrain Codex and Claude Code
diff --cc templates/bootstrap/template-repo/README.md
index b2a45e9127,b2a45e9127..4c8e18efa0
--- a/templates/bootstrap/template-repo/README.md
+++ b/templates/bootstrap/template-repo/README.md
@@@ -1,6 -1,6 +1,6 @@@
# gbrain agent workspace — template
--<!-- gbrain-template-stamp: 0.60.169.0 -->
++<!-- gbrain-template-stamp: 0.60.170.0 -->
This repository is the **"Use this template"** distribution artifact for a
[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same