Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge remote-tracking branch 'origin/master' into capy/gbrain-setup-codex-hash

garrytanc01175f13226
diff --cc docs/guides/repair.md
index 031ce59762,0b0a3aad10..08326c2c89
--- a/docs/guides/repair.md
+++ b/docs/guides/repair.md
@@@ -2024,9 -2022,67 +2024,67 @@@ the harness configuration, or a `gbrai
`gbrain setup` receipt owns it. Setup never falls back to a new local brain,
because sessions would then read an empty brain while useful memory stays on
the hosted one. Manage that connection with `gbrain connect <mcp-url>
---harness claude-code --install`; `gbrain doctor --only harness_wiring` shows
+--harness <claude-code|codex> --install`; `gbrain doctor --only harness_wiring` shows
which brain the registration reaches.
+ ## Connection notices
+
+ Two notices tell an agent, on its own MCP connection, why something it
+ expected is out of reach. Neither changes what the connection can call.
+
+ ### Grant blocked operations
+
+ `grant_blocked_operations` (info): this connection's grant cannot call some
+ operations its scopes allow. The notice says which proven blocker applies,
+ with counts and never operation names: the grant's operation snapshot, the
+ client's stored tool surface (a pin the brain owner set), or the server's
+ tool surface. A missing scope is named only on a refused call, because it is
+ how the grant was issued. Grant age is kept apart from the blockers: a grant
+ whose snapshot was written before snapshots recorded their operation catalog
+ says "this grant's snapshot excludes N currently eligible operations;
+ original intent unknown", and only a grant with recorded catalog provenance
+ says it predates operations. Operations outside the grant's scopes are never
+ counted, so a writer is not told about admin-only operations.
+
+ It arrives once per session: once per (principal, transport session) on
+ stdio and HTTP, and for a stateless HTTP call with no session id once per
+ (principal, grant revision), so a rescoped grant is diagnosed afresh.
+ `fix.next` is `tell_user_to_run`: the brain owner previews the change on the
+ brain host and then applies it (`then`). For an OAuth client that is
+ `gbrain auth rescope --client <client_id> --operations <OPERATIONS> --surface full --dry-run`
+ (`--surface full` only when the stored surface also blocks), then the same
+ command without `--dry-run`; for a legacy token,
+ `gbrain auth rescope --id <token_id> --refresh-operations` and then
+ `... --add <OPERATIONS>`. The owner chooses `<OPERATIONS>`. When only the
+ server's tool surface blocks, no grant change lifts it, and the fix is the
+ read-only doctor check that names the setting. `fix.verify` is read-only:
+ `gbrain doctor --only grant_new_ops_available --json` on the host, or
+ `whoami` on the same connection (its `grant_diagnosis` field carries the same
+ diagnosis). Nothing widens automatically; see
+ [grants that cannot reach new operations](../mcp/ADMIN.md#grants-that-cannot-reach-new-operations).
+
+ ### Hidden tool content
+
+ `hidden_tool_content` (info): a page read, search or query left out takes
+ (page reads and search never include the takes table for an agent-facing
+ reader) and the tool that lists them, `takes_list`, is not in this
+ connection's tool list. The notice counts the takes and names the result's
+ own pages, and its `fix` is the next step this connection can actually take:
+
+ - `takes_list` is callable but not listed (an advertised surface narrower
+ than the callable one): the fix is the `takes_list` call itself, and a
+ stdio session also adds it to its tool list. A client that ignores
+ `tools/list_changed` can still call it by name.
+ - one `request_tools {surface}` call would make it callable: the fix is that
+ call (stdio: this session only, nothing written; HTTP: the client's own
+ surface, within the server ceiling and never past an operator pin).
+ - otherwise only the brain host can change it: on HTTP the fix is the grant
+ repair from `grant_blocked_operations`; on stdio it is the tool's CLI
+ equivalent, relayed to the user.
+
+ A fix never names a call the connection cannot make: read-only access,
+ operator pins, the grant's snapshot and `GBRAIN_MCP_FORCE_SURFACE` all hold.
+
## Related
- [Write refusal reasons](write-refusals.md) — what a refused write means and the recovery command
diff --cc src/core/behavior-change-notice.ts
index 19d1fa5ff8,d2857c001e..8573ade8f8
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -479,8 -479,8 +479,10 @@@ export const BEHAVIOR_CHANGES: Readonly
{ since: '0.60.185.0', text: 'gbrain\'s own brain-repo commits (page write-through, facts fences, takes, timeline, `lint --fix`, and `sources harden` scaffolding) now take the checkout\'s commit lock (write-through waits 2 seconds, then commits its one path without it), commit only their own paths, and include both sides of a staged `git mv` rename. Paths passed to the helper or `gbrain git commit-push` are literal: a quoted glob no longer expands and fails `commit_paths_invalid`; name the files.' },
{ since: '0.60.185.0', text: 'The pull that `gbrain sources pull`, the pull cron, `sources harden` and the workspace push run no longer rebases: a branch whose local and remote sides diverged is merged in memory and the checkout fast-forwards to the merge, for `pull_strategy: rebase` as well as `merge` (`set-pull-strategy` is still accepted). `gbrain sync`\'s pull is now a fetch plus a fast-forward under the commit lock. `gbrain sources harden` sets `rebase.autoStash=false`, `merge.autoStash=false` and `pull.ff=only` in the checkout\'s local git config so a stray `git pull` refuses instead of autostashing. A conflict now stops with `integrate_conflict` (ask the user; resolve with `gbrain git commit-push --push-only --expect-remote <sha> --resolve <path>=ours|theirs`), and `put_page` reports an unresolved one for that checkout.' },
{ since: '0.60.185.0', text: 'The committed `scripts/brain-commit-push.sh` written by `gbrain sources harden` needs a gbrain that knows `git commit-push` to integrate remote commits. Without one it does only a locked, path-scoped commit and a plain push, and a rejected push now fails loudly (exit 4, PUSH FAILED) instead of rebasing. A helper written by a newer gbrain (a higher `# gbrain-protocol:` line) is never downgraded by an older harden.' },
+ // GBRA-60 D2/D4 in-band notices. `since` is provisional (current VERSION); restamped at the merge slot.
+ { since: '0.60.186.0', text: 'Two new info notices on MCP results; nothing a connection can call changes. `grant_blocked_operations` tells an authenticated connection once per session (once per grant revision for stateless HTTP) that its grant\'s operation snapshot, stored client surface or the server surface keeps operations its scopes allow out of reach, with counts and no operation names, and gives the brain owner\'s preview-then-apply rescope command (a missing scope is named only on a refused call). `hidden_tool_content` on get_page, search and query says when the result left out takes that a tool outside the tool list serves, with the next step that connection can take: the takes_list call (stdio also lists it), one request_tools {surface} widen, or the owner\'s repair. Fixes no longer name an MCP tool outside the grant\'s operation snapshot, and the stdio unknown-tool hint no longer offers a widen that read-only access or GBRAIN_MCP_FORCE_SURFACE would refuse.' },
+ // #6554 (GBRA-60 D8). `since` is provisional (current VERSION); the integrator restamps it at the merge slot.
+ { since: '0.60.184.0', text: '`gbrain bootstrap harness` now wires the Codex SessionEnd transcript-capture hook (its `hooks.json` group and `config.toml` trust entry) only when capture is on: turning capture off with its no-capture flag skips it, and registrar mode (a non-loopback `--url`) skips it like every other hook, because the hook talks to the local brain rather than the registered remote serve. The consent block names the hook when it is wired. A hook an earlier run installed stays until `gbrain bootstrap harness --remove`. New: `gbrain setup codex` wires Codex MCP and read-context hooks with hash-owned entries.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */