Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge origin/master into capy/w18b-lane4
garrytan92367aed258a
diff --cc src/core/error-registry.tsindex e95b427af1,a3df8e2a0b..cb4413c608--- a/src/core/error-registry.ts+++ b/src/core/error-registry.ts@@@ -61,9 -61,9 +61,10 @@@ export const CODES =api_not_enabled: { class: 'host_only', summary: "Google connect credential error: api not enabled.", docs: 'docs/guides/google-connect.md#troubleshooting' },approval_required: { class: 'consent', summary: "The change needs the owner's explicit approval before it can proceed." },autopilot_job_owned_by_other_brain: { class: 'caller', summary: "The autopilot job is bound to a different brain." },+ body_staging_expired: { class: 'retryable', summary: "The staged body of a large-page write expired before it was published, so nothing was published.", why: "A segmented write stages its segments first and publishes them in one flip; a staging idle past its deadline is collected by maintenance, and publishing without its segments would leave the page missing text.", suggestion: 'Send the same write again; it stages a fresh copy.' },budget_below_recent_runtime: { class: 'unavailable', summary: "The cycle's remaining budget fits fewer reflections than dream patterns needs at the recorded runtime, so the in-cycle run was skipped before any spend.", why: 'An in-cycle patterns run is sized from dream.patterns.last_run; a run that cannot finish in the budget would spend tokens and be killed.', docs: 'docs/guides/dream-patterns.md#budget-sizing', suggestion: 'Run `gbrain dream --phase patterns` outside the cycle after the user agrees to the paid run (it is not budget-limited and records its cost), or reset the record with `gbrain config unset dream.patterns.last_run`.' },backup_dump_failed: { class: 'host_only', summary: "`gbrain backup create` could not dump the PGLite data dir: an entry PGLite cannot read (a socket, FIFO or symlink that is not a dead gbrain socket) is still inside it.", why: "The backup removes only gbrain's own IPC sockets, and only when nothing listens on them; a live gbrain socket, a foreign socket or FIFO, or a symlink is left in place and named in the message, because the database lock proves no other PGLite owner, not who owns an arbitrary endpoint.", docs: 'docs/guides/in-agent-setup.md#6-back-up-the-complete-local-database', suggestion: 'Stop the process that uses each named entry (or move the entry out of the data dir), then rerun the same `gbrain backup create` command. Do not delete an entry something is still listening on.', fix: { argv: ['gbrain', 'doctor', '--json'], consent: [], actor: 'agent', why: "Read-only: reports the brain's lock holders and storage state so the user can see what still runs against the data dir.", requires_exclusive: false, verify: { argv: ['gbrain', 'doctor', '--json'] } } },+ backup_too_large: { class: 'host_only', summary: "`gbrain backup create` refused before writing anything: the PGLite brain's estimated archive size is over the 8 GiB backup-archive cap.", why: 'The archive format holds at most 8 GiB of payload and the dump is materialized in memory; refusing up front avoids a long dump that cannot be published.', docs: 'docs/guides/in-agent-setup.md#large-or-non-standard-brains-quiesced-physical-copy', suggestion: 'Take a quiesced physical copy of the data directory instead (stop writers, copy, open the copy in an isolated GBRAIN_HOME, verify with gbrain doctor --json).', fix: { ask_user: true, argv: ['gbrain', 'doctor', '--json'], consent: [], actor: 'agent', why: "Read-only, after the user agrees to the physical copy: doctor opens the brain only when no other gbrain process holds it, so a clean run shows the writers are stopped.", user_message: "This brain is outside what `gbrain backup create` can archive. Stop every gbrain writer on it (gbrain serve, jobs, autopilot, agent sessions), copy the whole data directory and config.json into a new isolated GBRAIN_HOME, point the copy's database_path at the copied data directory, then run gbrain doctor --json with GBRAIN_HOME set to the copy before relying on it.", requires_exclusive: false, verify: { argv: ['gbrain', 'doctor', '--json'] } } },benchmark_duplicate_task_id: { class: 'caller', summary: "Benchmark duplicate task id." },benchmark_empty: { class: 'caller', summary: "The benchmark file has no tasks." },benchmark_exists: { class: 'caller', summary: "A benchmark already exists at the target path." },