diff --git a/src/core/message-parsing/__tests__/directive-streaming-parser.spec.ts b/src/core/message-parsing/__tests__/directive-streaming-parser.spec.ts index 1d6957a827..66012c24a0 100644 --- a/src/core/message-parsing/__tests__/directive-streaming-parser.spec.ts +++ b/src/core/message-parsing/__tests__/directive-streaming-parser.spec.ts @@ -64,4 +64,18 @@ suite("DirectiveStreamingParser", () => { } as ToolDirective, ]) }) + + test("should not parse directives inside triple backticks as directives", () => { + const input = + "Some text with\n```\n\nThis is a warning message\nwarn\n\n```\nMore text" + const result = DirectiveStreamingParser.parse(input) + expect(result).toEqual([ + { + type: "text", + content: + "Some text with\n```\n\nThis is a warning message\nwarn\n\n```\nMore text", + partial: true, + } as TextDirective, + ]) + }) })