Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge remote-tracking branch 'origin/master' into capy/one-shot-cli-writes

garrytan7cd47464f4e7
diff --cc src/mcp/dispatch.ts
index 87c1072e94,471dc2722f..1cb0d43f48
--- a/src/mcp/dispatch.ts
+++ b/src/mcp/dispatch.ts
@@@ -47,8 -47,10 +47,10 @@@ import { maybeRefreshBackupStatusInProc
import { operationScopesAllowed } from '../core/scope.ts';
import { enforceReadTrustFloor } from '../core/eligibility/registry.ts';
import { invalidateHotMemoryForEngine } from '../core/facts/meta-hook.ts';
+ import { withSearchConnectionBudget } from '../core/search/connection-budget.ts';
+ import { isEngineDegraded } from '../core/degraded-marker.ts';
import { admittedPendingReceipt, type WriteReceipt } from '../core/persistence/types.ts';
-import { currentVerifiedLocalWriter, readLocalWriter, verifyLocalWriter, withVerifiedLocalRegistration } from '../core/persistence/identity.ts';
+import { currentVerifiedLocalWriter, readLocalWriter, verifyLocalWriter, withRequestIdentityMemo, withVerifiedLocalRegistration } from '../core/persistence/identity.ts';
import { frameOverCap, resultTooLargeError } from '../core/egress-budget.ts';
// WP3: normalization + validation moved to validate-params.ts (direct unit
@@@ -872,8 -874,8 +874,9 @@@ export async function dispatchToolCall
): Promise<ToolResult> {
// #6721: a read op answers every config read from one snapshot of the table
// (config-snapshot.ts); a write reads config live, so it sees its own writes.
- const run = () => dispatchResolvedCall(engine, name, params, opts);
+ // GBRA-156: and reads the brain identity and each local writer's credential once for its pre-submission checks.
+ const run = () => withRequestIdentityMemo(() => dispatchResolvedCall(engine, name, params, opts));
+ if (name === 'search' || name === 'query') return withSearchConnectionBudget(() => withRequestConfigSnapshot(engine, run));
return operations.find(o => o.name === name)?.mutating === false
? withRequestConfigSnapshot(engine, run)
: withoutRequestConfigSnapshot(run);