fix: finish exec tool failure landing (#52508) (thanks @martingarramon)

This commit is contained in:
Peter Steinberger
2026-03-23 02:18:15 +00:00
parent 22c75a55b0
commit f8731b3d9d
2 changed files with 14 additions and 3 deletions

View File

@@ -462,11 +462,21 @@ describe("exec tool backgrounding", () => {
allowBackground: false,
});
const result = await executeExecCommand(customBash, longDelayCmd);
const text = (result as { content: { text: string }[] }).content[0].text;
const text = readTextContent(result.content);
expect(text).toMatch(/timed out/i);
expect(text).toMatch(/re-run with a higher timeout/i);
const details = (result as { details: { status: string } }).details;
expect(details.status).toBe("failed");
const details = result.details as {
status?: string;
exitCode?: number | null;
durationMs?: number;
aggregated?: string;
};
expect(details).toMatchObject({
status: "failed",
exitCode: null,
aggregated: "",
});
expect(details.durationMs).toEqual(expect.any(Number));
});
it.each<DisallowedElevationCase>(DISALLOWED_ELEVATION_CASES)(