Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mcp-server/.synced-from
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cdb84e9feeea268294b672792c5c72620bb020ae
83899f06c4aec70ddf70684c7e7e6b1134db69a4
18 changes: 18 additions & 0 deletions mcp-server/src/tools/context/get-context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
10 changes: 10 additions & 0 deletions mcp-server/src/tools/context/get-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -138,6 +144,7 @@ const handler = async (args: z.infer<typeof zodSchema>) => {
limit = 10,
page = 0,
max_length,
include_flaky,
} = parsed.data;

const queryParams = new URLSearchParams();
Expand All @@ -152,6 +159,9 @@ const handler = async (args: z.infer<typeof zodSchema>) => {
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'
Expand Down
Loading