Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(protocol): conformance reads the content[0] body; notice blocks after it are model-visible advice, not protocol JSON

garrytan193062838dfe
diff --git a/src/commands/protocol.ts b/src/commands/protocol.ts
index 4d938dec23..c22f758e1a 100644
--- a/src/commands/protocol.ts
+++ b/src/commands/protocol.ts
@@ -189,8 +189,9 @@ async function runConformanceCommand(args: string[]): Promise<void> {
isError?: boolean;
content?: Array<{ type?: string; text?: string }>;
};
- const text = (res.content ?? []).map(c => (typeof c.text === 'string' ? c.text : '')).join('\n');
- return { isError: res.isError, text };
+ // The protocol body is content[0] alone (D3); later blocks are model-visible notices.
+ const first = res.content?.[0];
+ return { isError: res.isError, text: typeof first?.text === 'string' ? first.text : '' };
},
};