Garry's Opinionated OpenClaw/Hermes Agent Brain
Upgrade to v0.60.5.0: keep database-only history, unwedge managed brains, stop paid loops
This release stops page writes from deleting timeline history that exists only in the database, writes that history back into pages, and makes extracted atoms and synthesized concepts private unless their origin is public. It also fixes several ways a managed brain got permanently stuck, raises managed write capacity, stops dream from re-billing the same transcripts, releases idle Postgres connections and guards large PGLite imports.
Four additive schema migrations run automatically: v170 (partial index for
parked postcommit effects), v171 (nullable content_chunks.embedding_input_hash),
v172 (partial index of pages below the safe-chunk fence) and v173 (partial index
on dead subagent jobs). None deletes data, write IDs or receipts, and none
starts a background service.
Confirm a database backup exists before anything else writes to the brain. Ask the user whether they have a recent backup of the database itself:
pg_dumpfor Postgres, or a copy of the PGLite data directory made while gbrain was stopped. A Markdown export (gbrain export) does not include database-only timeline entries. If there is no backup, tell the user and recommend making one now. Do not make it for them without asking.Upgrade every process that writes to this brain. An older gbrain process keeps deleting database-only timeline history every time it republishes a page. List the writers with the user:
gbrain serve, autopilot and job supervisors, session hooks and any other machine or global CLI install that uses this database. Each must rungbrain upgradeand then be restarted.gbrain --version # expect 0.60.5.0 on every writer gbrain autopilot --status --json gbrain jobs supervisor status --jsonIf schema work did not complete, run
gbrain apply-migrations --yes --no-autopilot-installon the brain host. Do not change the operator's search mode or engine.Tell the user what was lost, plainly. If pages were edited, synced, imported, reconciled or refreshed by a connector while an older writer ran, timeline entries that had no Markdown bullet may be gone. This release cannot restore them. Recovering them needs a database backup taken before the loss. Do not promise recovery without one.
Run one full doctor pass (not
--fast) and relay the new signals.gbrain doctor --jsontimeline_historycounts timeline entries that exist only in the database.details.countsays whether the number isexactor alower_bound(the scan stops after 2,000 pages or 10 seconds).kept_unrenderable_rowsare entries that cannot be written as a bullet without changing them (for example an empty source); they are kept as-is and need no action.derived_visibilitycounts atoms and synthesized concepts without an explicit visibility, or stored looser than their origin. Remote readers already treat all of them as private.contextual_retrieval_coveragenow counts pages of every kind below the safe-chunk index version (details.unsealed_pages, withdetails.unsealed_code_pagesfor code). Remote and MCP search withhold those pages' chunks. The count used to cover markdown only, so it may rise after upgrading even though nothing changed.persistence_capacity: a principal or the brain uses 80% or more of its permanent write IDs or receipt bytes. Run thegbrain config set persistence.limits.<key> <value>command the check prints, on the brain host, after the user agrees. Raising a limit is a mitigation; IDs stay permanent.parked_effects: a Git or withdrawal target failed five times in a row and was set aside. Inspectgbrain sources writer status <source>, fix the named cause, preview with the printedgbrain sources writer retry-effects <source> --request-id <id> --dry-run, then run it without--dry-runto authorize one more attempt.dream_paid_loop: dream keys whose jobs died 3 times in 24 hours and are now refused. Show the operator the keys and the reset command it prints. Do not reset a key on your own: the operator should first fix why those jobs die (a missing provider key, a failing transcript, a quota), then rungbrain dream reset-key '<key>'.gbrain dream reset-key --listlists every refused key.
Health scores may drop by these warnings until the repairs below run.
Preview the repairs, then apply them on the brain host. Every kind is a dry run unless
--applyis passed. Show the user the preview first; it prints the resolved brain and sources, the pages affected, the request-ID cost and, for safe-chunks, the estimated embedding cost.gbrain repair # preview every kind gbrain repair timeline --apply # write database-only entries back into their pages gbrain repair visibility --apply # stamp explicit visibility, tighten-only gbrain repair safe-chunks --apply # re-seal withheld pages, then embed chunks that need it gbrain repair safe-chunks --apply --no-embed # re-seal text only; embed laterAdd
--source <id>to limit a run to one source and--limit <n>to repair in batches; rerunning the same command resumes where it stopped. The safe-chunks kind takes no journal admissions and never hits a capacity limit. If the timeline or visibility repair stops near a journal capacity limit, it prints the exactgbrain config set persistence.limits.<key> <value>that lets it finish; ask the user before raising a limit. If it reports that the writer is held, inspectgbrain sources writer status <source>and rerun. With--no-embed, rungbrain embed --stalelater (ask the user first; it calls the embedding provider). A thin client refusesgbrain repair; the brain host operator runs it.What changes for the user.
- Saved pages may gain marked bullets (
<!-- gbrain:materialized v1 <hash> -->followed by a bullet) for history that previously existed only in the database. Deleting such a bullet with aput_pagethat passes the currentexpected_revisiondeletes its entry. A save without a revision, and a connector refresh, keep marked entries and write them back. Managed sync never rewrites the user's own file to add them. - A page write that adds a takes row whose number already belongs to a
database-only take fails with
take_row_collision. Renumber the new row, or add the existing take to the page's takes table with a revision-boundput_page. - Atoms from transcripts or from pages that are private or no longer exist
are private. Do not set
search.remote_private_pagesto restore remote access; that exposes every private page. - Pages that refused writes because of a missing
type:line, a trimmed title, a Git-subfolder source path, a macOS device renumbering or acapture --filepath accept writes again without a repair. A refusal that remains now names its reason (file_database_drift,ambiguous_source_path,physical_root_device_changed,cursor_processing_options_conflict,invalid_source_uri) and the command to run. persistence.receipt_retention_days(default 30) is configurable. Only change it when the user asks.- The first rebuild of a contextual-retrieval page re-embeds it once; after
that, unchanged pages keep their vectors. Remote search results carry
safe_index_pendingwhenever pages in the caller's scope are withheld, even when some results came back. - A claude.ai connector stuck read-only needs to be removed and re-added; a looping ChatGPT connector needs to be reconnected.
- Saved pages may gain marked bullets (
Verify:
gbrain --version gbrain repair --json # every kind reports 0 items gbrain doctor --json # timeline_history, derived_visibility ok; unsealed_pages 0 gbrain timeline <slug> # an edited page still lists its older entries
If a step fails, keep the doctor output and do not delete receipts, counters, effect rows or dead jobs to make a warning disappear.