From cf414564eff08a56384d4ddc44555fd34e6c2c69 Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 01:46:12 +0100 Subject: [PATCH] test: tighten message tool schema description assertion --- src/agents/tools/message-tool.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/agents/tools/message-tool.test.ts b/src/agents/tools/message-tool.test.ts index 72f207c1de28..71f457ce427a 100644 --- a/src/agents/tools/message-tool.test.ts +++ b/src/agents/tools/message-tool.test.ts @@ -240,7 +240,7 @@ function getActionEnum(properties: Record) { function expectStringSchema( schema: unknown, expected?: { - descriptionIncludes?: string; + description?: string; }, ) { expect(schema).toBeTruthy(); @@ -249,8 +249,8 @@ function expectStringSchema( } const record = schema as Record; expect(record.type).toBe("string"); - if (expected?.descriptionIncludes) { - expect(record.description).toEqual(expect.stringContaining(expected.descriptionIncludes)); + if (expected?.description) { + expect(record.description).toBe(expected.description); } } @@ -1065,7 +1065,10 @@ describe("message tool schema scoping", () => { const properties = getToolProperties(tool); expect(getActionEnum(properties)).toContain("read"); - expectStringSchema(properties.messageId, { descriptionIncludes: "read" }); + expectStringSchema(properties.messageId, { + description: + "Target message id for read, reaction, edit, delete, pin, or unpin. If omitted for reaction-like actions, defaults to the current inbound message id when available.", + }); }); });