Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(pinned-questions): zero-leakage loop sends each questions_* tool only its declared params
garrytan3e9e2f80a3fc
diff --git a/test/helpers/pinned-questions-scenarios.ts b/test/helpers/pinned-questions-scenarios.tsindex f4754499cc..3209d4a695 100644--- a/test/helpers/pinned-questions-scenarios.ts+++ b/test/helpers/pinned-questions-scenarios.ts@@ -173,8 +173,15 @@ export function registerPinnedQuestionSuite(label: string, getEngine: () => Brai.toEqual({ tool, leaked: false });if (tool === 'get_page') expect(result.isError).toBe(true);}- for (const tool of ['questions_list', 'questions_status', 'questions_refresh', 'questions_unpin', 'questions_pin']) {- const { result, body } = await mcp(engine, tool, { id: pinned.receipt.id, question: QUESTION }, g);+ const id = pinned.receipt.id;+ for (const [tool, params] of [+ ['questions_list', { include_archived: true }],+ ['questions_status', { id }],+ ['questions_refresh', { id, full: true }],+ ['questions_unpin', { id }],+ ['questions_pin', { id, question: QUESTION }],+ ] as Array<[string, Record<string, unknown>]>) {+ const { result, body } = await mcp(engine, tool, params, g);expect({ tool, isError: result.isError, code: body.code }).toEqual({ tool, isError: true, code: 'question_owner_only' });expect(JSON.stringify(body)).not.toContain(CANARY);}