Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
11.2 KB
Raw Blame

Upgrade to v0.60.20.0: fix wave 4

Fix wave 4 fixes managed syncs that wedged on large request tables, connector sources that one bad item stopped forever, managed upgrade migrations that stayed stuck, and several lifecycle gaps (leaving managed mode, stuck embedding effects, bindings left by removed sources). Never apply a repair, raise a limit or clear a wedged marker on the user's behalf without asking.

Schema migrations (automatic)

Five schema migrations run on gbrain upgrade (or gbrain apply-migrations --yes). None deletes a page, a receipt or a write ID, and a rerun changes nothing:

  • 179 builds the managed sync request indexes persistence_requests_sync_run_open and persistence_requests_sync_run_committed. On Postgres it runs CREATE INDEX CONCURRENTLY, one index at a time, so writes continue; on a large persistence_requests table it can take minutes and prints building <index> on ~N rows; this can take minutes; it is safe to leave running.
  • 180 adds the nullable pages.links_attendance_blocked_revision and links_attendance_blocked_at columns (the attendance marker, #5761).
  • 181 (handler) records a first sync attempt for every Google and GitHub source the previous autopilot dispatched (a non-null local_path and not syncEnabled=false). Autopilot now dispatches a connector only after a recorded attempt, so no source autopilot synced before the upgrade goes idle.
  • 182 adds the nullable page_versions.source_path, so persistence.unbound_write=database_only judges a revert on the version it writes. Older versions count as file-less.
  • 183 adds persistence_brain.mode_epoch and the retired worktree state for gbrain sources writer deactivate.

Upgrade order on multi-host brains

Upgrade the hosts that run the persistence consumer before connector hosts, as in v0.60.11.0. An older consumer refuses a new connector's page writes (revision_conflict) instead of losing data, and they commit once the consumer is upgraded.

Managed sync: request indexes, the checkpoint timeout and working-tree skips (#5762, #5751, #5522)

Never apply a repair or raise a limit on the user's behalf without asking.

  1. Check the indexes. Run gbrain doctor and read persistence_request_indexes. If it names gbrain repair request-indexes --apply (an index is missing or INVALID after an interrupted build), show the user gbrain repair request-indexes (preview), then apply it after they agree. If it says an index is still building, leave it running.
  2. Clear a timed-out sync checkpoint. If a sync printed checkpoint_validation_timeout, run the commands it printed, in order: the rebuild when the hint says an index is missing or INVALID, then the printed gbrain sync --source <id> --no-pull --retry-failed … (it keeps the run's saved --no-embed / --no-extract / --no-schema-pack flags). Do not cancel the checkpoint request: a cancelled checkpoint still blocks the next.
  3. Check request-table growth. Read persistence_request_growth in gbrain doctor --json. When it warns, tell the user which writer runs out of lifetime request IDs and when, and offer the printed gbrain config set persistence.limits.<limit> <value>. Request IDs are permanent; raising the limit is the only intervention. Re-run the check to verify.
  4. Working-tree syncs. A managed working-tree sync now skips an unchanged legacy file whose page has no contextual retrieval mode, or whose bytes are not valid UTF-8, instead of admitting it every run. When the sync summary prints legacy file(s) skipped … no contextual retrieval mode, preview gbrain repair contextual-mode with the user and apply it after they agree. When it prints … not valid UTF-8, list the files with find <checkout> -name '*.md' ! -exec iconv -f UTF-8 -t UTF-8 -o /dev/null {} \; -print and ask the user whether to re-save them as UTF-8.
  5. Verify: gbrain doctor shows persistence_request_indexes ok, and gbrain sources status shows each managed source's last_commit advancing after its next sync.

Connectors: held items, the dispatch gate and fence refusals (#5752, #5740, #5739, #5581, #5438, #5673)

Nothing here needs a command. Tell the user, and ask before running anything that changes the brain:

  1. Held items. A Google or GitHub item that fails three syncs in a row is held instead of wedging the source. Existing Gmail poison-ledger entries (gmail_fail_counts) are carried over once: a thread that failed three or more times becomes a held item with unknown sender, subject and date. Check with:

    gbrain sources status            # held items per source
    gbrain doctor                    # connector_held_items
    

    After the user agrees and the cause is fixed:

    gbrain sources retry-held <id> --dry-run
    gbrain sources retry-held <id>
    gbrain sync --source <id>
    gbrain sources status <id>       # a recovered item leaves the list
    
  2. A connector source that has never synced now stays idle under autopilot and prints one notice. Run gbrain sync --source <id> once to enable it.

  3. connector_fence_below_timeline. A managed connector sync may refuse a page whose facts or takes fence sits below its timeline. Preview gbrain repair connector-fences --source <id>, apply it after the user agrees with --apply, then gbrain sources retry-held <id>.

  4. gbrain waiting may now say coverage is partial and name held Gmail threads. Present that answer as partial.

The managed migration chain, atoms and facts (#5728, #5721, #5699, #5725, #5627, #5705, #5733, #5634)

On a managed brain the v0.28.0 takes backfill and the v0.32.2 facts backfill now publish through the persistence coordinator. Before this release v0.28.0 was refused by the managed writer guard, recorded partial three times and then wedged, and every later migration stayed pending behind it. v0.32.2 is now also run on managed brains, including database-only pages; it adopts the legacy fact rows in place, so fact ids, vectors and extractor rows are kept.

Never raise a limit or clear a wedged marker on the user's behalf without asking.

  1. Check whether the chain is stuck.

    gbrain apply-migrations --list
    

    A wedged status on 0.28.0 means a pre-upgrade run gave up. After the user agrees, clear that marker once:

    gbrain apply-migrations --force-retry 0.28.0
    
  2. Run the chain.

    gbrain apply-migrations --yes
    

    On a managed brain this finishes v0.28.0, v0.29.1, v0.31.0, v0.32.2, v0.43.0 and v0.46.3. A run with nothing pending prints "All migrations up to date".

  3. If a migration refuses with queue_capacity. The brain or the migration writer has used up its permanent request IDs. The refusal happens before any page changes and prints the exact command, for example gbrain config set persistence.limits.principal_lifetime_ids <value>. Show the user the command and the value; after they agree, run it and repeat step 2.

  4. Verify.

    gbrain apply-migrations --list
    gbrain doctor
    

    Every orchestrator migration should read applied. 0.14.0 and 0.53.0 may still list host work; that is expected.

Other changes in this part need no action: legacy database-only atoms can now be stamped by gbrain repair visibility, an explicit atom retry survives a revision-only page change, remember on fact-heavy pages no longer times out, patterns pages carry dream_generated, and unify-types apply refuses up front on a managed brain (its dry run still previews).

Lifecycle: upgrade outcome, orphan bindings, embedding effects, deactivate (#5693, #5732, #5629, #5734, #5673, #5393, #5455, #5628)

  1. gbrain upgrade now ends with a Binary: line and a separate Migrations: line. Migrations: running (host …, pid …) means another apply-migrations holds the orchestration lock; wait for it, then run gbrain apply-migrations --yes to confirm.
  2. Run gbrain doctor. Preview and, after the user agrees, apply what it names: gbrain repair orphan-bindings (bindings left by removed sources) and gbrain repair embedding-effects --source <id> (stuck embedding effects). Both appear in gbrain doctor --remediation-plan.
  3. A connector source autopilot never synced stays idle until gbrain sync --source <id> runs once. Clear a connector's stale folder with gbrain sources set-path <id> --clear.
  4. To leave managed mode, follow docs/architecture/topologies.md#deactivate-runbook. Older binaries still honor local managed markers, so after deactivating run gbrain sources writer status once on every other host before an older binary writes there.

The min_writer_version floor stays deferred: while a brain is managed the database writer guard is the enforcement, and after deactivation that guard is inert.

Links, capture, search, CLI and ingestion (#5749, #5701, #5691, #5671, #5761, #5742, #5765)

No step here changes the brain without the user's agreement.

  1. Frontmatter links the stale sweep moved (#5749). On brains with link_resolution.global_basename=true, the managed stale-link sweep could re-point a bare frontmatter wikilink (for example related: [[topic]]) at a transcript that repeats the term. This release moves the link extractor watermark, so every page re-extracts links once. Let the next sync or autopilot cycle run, or, with the user's agreement, run it now:

    gbrain extract --stale --catch-up --include-frontmatter
    
  2. Query instruction prefix (#5691, #3783). Nothing changes unless the user sets it. If gbrain doctor reports embedding_query_prefix, show the user the command it prints and run it only if they agree. It affects query embeddings only; stored vectors are not re-embedded. Undo with gbrain config unset embedding_query_prefix.

  3. Private facts over HTTP (#5671). If doctor's memory_writeback check warns that facts.default_visibility is private while agents read the brain over MCP or HTTP, ask the user whether those agents need to recall their own facts. If yes: gbrain config set facts.default_visibility world, then gbrain bootstrap harness --yes to refresh the installed instruction blocks (their private-posture text changed and shows as drifted until refreshed).

  4. Attendance-blocked meeting pages (#5761). Doctor's links_extraction_lag reports meeting pages that wait on an unresolved attendee in their own count.

  5. Historical dates (#5742). Pages whose explicit frontmatter date is before 1990 were dated by ingest time. With the user's agreement, preview and apply the recompute:

    gbrain reindex-frontmatter --dry-run
    gbrain reindex-frontmatter --yes
    
  6. Meeting pages with a bold **Attendees:** line (#5765) gain their attended edges on the next gbrain extract --stale (the step 1 run covers it).

  7. Long sessions (#5701). Claude Code and Codex sessions over 50 MiB are captured again from their recent tail. No action.

Verify: gbrain doctor shows no embedding_query_prefix warning (or the user chose not to set one), and gbrain get <page> --include-timeline-entries returns the page's timeline rows.