From 4e422d9bc1abb3a5c7706df1b9d11ab91cb363f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Oct 2026 06:48:07 +0000 Subject: [PATCH] chore: sync MCP source from the monorepo at 83899f0 Published by release/2026-10-07-002. Previous sync: cdb84e9feeea268294b672792c5c72620bb020ae. --- mcp-server/.synced-from | 2 +- .../src/tools/context/get-context.test.ts | 18 ++++++++++++++++++ mcp-server/src/tools/context/get-context.ts | 10 ++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/mcp-server/.synced-from b/mcp-server/.synced-from index fe319f0..e70af52 100644 --- a/mcp-server/.synced-from +++ b/mcp-server/.synced-from @@ -1 +1 @@ -cdb84e9feeea268294b672792c5c72620bb020ae +83899f06c4aec70ddf70684c7e7e6b1134db69a4 diff --git a/mcp-server/src/tools/context/get-context.test.ts b/mcp-server/src/tools/context/get-context.test.ts index 0e8e75d..d1b0697 100644 --- a/mcp-server/src/tools/context/get-context.test.ts +++ b/mcp-server/src/tools/context/get-context.test.ts @@ -110,6 +110,24 @@ describe('getContextTool', () => { ); }); + it('sends include_flaky to GET /context when set', async () => { + await getContextTool.handler({ run_id: 'run-1', include_flaky: true }); + + expect(fetch).toHaveBeenCalledWith( + 'https://api.test.com/v1/context?run_id=run-1&format=json&detail=default&limit=10&page=0&include_flaky=true', + expect.anything() + ); + }); + + it('leaves include_flaky out of GET /context when omitted', async () => { + await getContextTool.handler({ run_id: 'run-1' }); + + expect(fetch).toHaveBeenCalledWith( + 'https://api.test.com/v1/context?run_id=run-1&format=json&detail=default&limit=10&page=0', + expect.anything() + ); + }); + // This tool reads markdown, so it cannot go through the verb helpers that // carry the retry — and a read is the call the retry is most for. it('sends a read the API failed to serve again', async () => { diff --git a/mcp-server/src/tools/context/get-context.ts b/mcp-server/src/tools/context/get-context.ts index 143cdf1..da534fd 100644 --- a/mcp-server/src/tools/context/get-context.ts +++ b/mcp-server/src/tools/context/get-context.ts @@ -76,6 +76,12 @@ const zodSchema = z .describe( 'Truncate markdown response to this character limit (only applies when format=md).' ), + include_flaky: z + .boolean() + .optional() + .describe( + 'Run-level only. When true, flaky tests are listed after the failed tests, each with the error from its last failed attempt, and limit and page count across both. Defaults to false.' + ), }) .superRefine((val, ctx) => { const { run_id, instance_id, test_id } = val; @@ -138,6 +144,7 @@ const handler = async (args: z.infer) => { limit = 10, page = 0, max_length, + include_flaky, } = parsed.data; const queryParams = new URLSearchParams(); @@ -152,6 +159,9 @@ const handler = async (args: z.infer) => { if (max_length !== undefined) { queryParams.append('max_length', max_length.toString()); } + if (include_flaky !== undefined) { + queryParams.append('include_flaky', include_flaky.toString()); + } const headers = apiHeaders( format === 'md'