Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: verify on the train (attest sources in the HTTP test type; memberByEmail suggestion names the address, no placeholder)

garrytan4f1b6f0f6388
diff --git a/src/core/access/members.ts b/src/core/access/members.ts
index 2b8c7ddd30..bb337c1b48 100644
--- a/src/core/access/members.ts
+++ b/src/core/access/members.ts
@@ -146,7 +146,7 @@ export async function memberByEmail(engine: BrainEngine, raw: unknown): Promise<
if (rows.length === 1) return toRecord(rows[0]!);
if (!rows.length) {
throw opError('not_found', 'No member declares that email.',
- 'List members and their emails with gbrain access member list, or declare it: gbrain access member set <id> --email <addr>.',
+ `List members and their emails with gbrain access member list, then declare it on the right member: gbrain access member set followed by that member's id and --email ${email}.`,
{ why: 'An email only finds a member an operator declared it on; it never creates a member or a link.', fix: MEMBER_LIST_FIX });
}
throw memberInvalid(`${rows.length} members declare that email.`, 'email_ambiguous',
diff --git a/test/serve-http-access.test.ts b/test/serve-http-access.test.ts
index b588d896f0..19ace7d131 100644
--- a/test/serve-http-access.test.ts
+++ b/test/serve-http-access.test.ts
@@ -167,7 +167,7 @@ for (const kind of testBackends()) {
const applied = await call('POST', '/admin/api/access/attest', { clientId: qm.clientId, attestActor: 'qm', attestOps: ['memory_recall', 'memory_write', 'get_write_request'] });
expect(applied.json).toMatchObject({ applied: true, attest_actor: 'qm', attest_ops: ['get_write_request', 'memory_recall', 'memory_write'] });
const token = (await provider().exchangeClientCredentials(qm.clientId, qm.clientSecret!)).access_token;
- const auth = await provider().verifyAccessToken(token) as unknown as { attest?: { system: string; ops: string[] } | null };
+ const auth = await provider().verifyAccessToken(token) as unknown as { attest?: { system: string; ops: string[]; sources: string[] | null } | null };
expect(auth.attest).toEqual({ system: 'qm', ops: ['get_write_request', 'memory_recall', 'memory_write'], sources: null });
expect((await call('POST', '/admin/api/access/attest', { clientId: qm.clientId, attestOps: ['capture'] })).json).toMatchObject({ code: 'invalid_params' });