Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
7.9 KB
Raw Blame

Upgrade to v0.60.11.0: resume connectors, finish managed maintenance, then preview and apply the agreed repairs

This release makes managed Google and GitHub connectors resume their saved cursor and skip unchanged pages, moves the remaining maintenance writers on managed brains onto the persistence coordinator, refuses degenerate embedding vectors per chunk, and wires every gbrain repair kind into doctor's remediation plan with a preview-only banner after gbrain post-upgrade.

Three migrations run automatically. None deletes a page, a receipt or a write ID, holds a long transaction or starts a background service, and a rerun changes nothing:

  • 176 (handler) copies each connector source's newest committed checkpoint to its stable key, marks a source whose newest checkpoint receipt was compacted to re-walk once, and removes checkpoint rows no source can load.
  • 177 adds pages.database_only_reason (nullable) for pages saved database-only to an unbound Postgres source.
  • 178 adds five nullable writer-version columns to persistence_requests and records its cutoff with the database clock.

Never apply a repair, raise a limit, lock, unlock or resume on the user's behalf without asking. Every step below that changes the brain needs the user's agreement first.

  1. Upgrade hosts in order, with autopilot paused. List with the user every host that uses this brain. On each host that runs connector jobs, pause autopilot first; upgrade the hosts that run the persistence consumer or own a worktree before the connector hosts; then resume:

    gbrain autopilot pause --reason "upgrading to v0.60.11.0"   # each connector host
    gbrain upgrade                                              # consumer and worktree-owner hosts first
    gbrain upgrade                                              # then connector hosts
    gbrain doctor --remediation-plan                            # step 4
    gbrain autopilot resume                                     # each host you paused
    gbrain sources status                                       # verify (step 3)
    

    The pause survives gbrain upgrade. Mixed versions refuse with typed errors instead of losing data: a new connector talking to an old consumer fails unsupported_mutation_protocol and names the consumer upgrade; an old connector talking to a new consumer fails connector_intent_outdated. If schema work did not complete, run gbrain apply-migrations --yes --no-autopilot-install on the brain host.

  2. Tell the user to expect one connector re-walk, once. Connector writes queued before the upgrade fail once with connector_intent_outdated (detail pre_upgrade, no action needed) and are fetched again on the next run. A source the migration marked to re-walk re-admits its window once. This first spike is expected and is not the hourly churn this release fixes. The post-upgrade banner prints the count as connector_rewalk.

  3. Verify connectors with gbrain sources status --json. Each connector source has a connector block (shape). After the second run, a quiet source shows last_run.page_admissions: 0.

    • For each source the migration printed resumed from pre-upgrade checkpoint of <time> (kept as resumed_from): if the user changed a content setting such as g_history_days since then, run gbrain sync --source <id> --reset-checkpoint. Unchanged pages are not admitted again.
    • Each connector source pins the account its credential resolves to on its first run. If a run refuses connector_account_changed, relay its two branches: restore the credential for the pinned account, or add a new source for the new account and archive the old one. No reset flag changes the account.
  4. Relay the post-upgrade banner, then preview the recovery plan and ask. When gbrain post-upgrade prints an [AGENT] Relay this to your operator block, show it to the user as-is. It lists each finding and its count and never applies anything. Then:

    gbrain doctor --remediation-plan
    

    Show the user the repair steps (each marked "requires user agreement"), their estimated cost, and the combined command at the end. The kinds are timeline, visibility, safe-chunks, contextual-mode (stamps the contextual retrieval mode on pages imported without one; may re-embed a page whose input changes) and connector-checkpoints (removes orphan connector cursor rows; free). Ask which to apply and what spending cap they accept.

  5. Apply only what the user agreed to, with their cap:

    gbrain doctor --remediate --yes --include-repairs --expect <plan_hash> --max-usd <n>
    

    <plan_hash> is the plan_hash from gbrain doctor --remediation-plan --json (gbrain v0.60.46.0 and later bind repair approval to the previewed plan).

    Pass --no-embed if they want no paid embeddings (then gbrain embed --stale later). If the run stops as budget-exhausted, ask again before running the printed resume command; the cap is cumulative across resumes.

  6. Report what is left. The run prints each remaining finding with its class. For operator_required, relay the instruction (for example the #5413 quarantine commands in docs/guides/repair.md#quarantine-self-captured-corpus-files, gbrain upgrade on a host that writer_version names, or the reset command dream_paid_loop prints). For unsupported, tell the user it is known and cannot be cleared yet.

  7. Postgres sources with a checkout folder but no owner. Saving a page there still refuses by default, with owner_unavailable and detail unbound_source. Ask the user which fix they want; do not pick for them:

    • bind the source: gbrain sources writer status <source> --json, then the printed gbrain sources writer claim <source> --path <path> --admin-intent writer_claim --expected-state <admin_state>; or
    • allow database-only saves: gbrain config set persistence.unbound_write database_only. Pages saved this way stay database-only after the source is bound.

    gbrain doctor reports unbound_source: ok while the source is unbound, a warning once it is bound. When a canonical file later appears at such a page's path, preview both sides with gbrain sources reconcile <source> <slug> --brain <brain> --preview and apply only the resolution the user chose.

  8. Tell the user what else changes.

    • Global maintenance keeps running when one phase fails; the run is reported as partial and gbrain dream exits non-zero. Concept synthesis, chronicle extraction, the purge of deleted pages, enrichment, add_link / remove_link, bootstrap verify and the facts writers now work on managed brains.
    • An embedding provider that returns an all-zero or broken vector for a chunk now gets that chunk refused with embedding_zero_norm; the page keeps its text and every other vector, and the failure names gbrain embed <slug>.
    • gbrain migrate embeddings --max-cost-usd <n> stops with embedding_budget_below_worst_case before changing anything when the cap is below the printed worst case. Rerun only with the user's agreement.
    • If the user saw "gbrain repaired this brain's PGLite WAL in place", run gbrain reindex --vectors (free; nothing is re-embedded).
  9. Verify.

    gbrain doctor --remediation-plan         # no repair steps left
    gbrain sources status --json             # quiet connectors: page_admissions 0
    gbrain sources writer status --json      # writer versions per host
    

Optional, only if the user asks: gbrain sources writer lock stops agents from claiming, activating or transferring writers on this brain until the operator runs gbrain sources writer unlock. See the writer admin lock in docs/architecture/topologies.md.