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
4 changes: 2 additions & 2 deletions src/tools/rca-agent-utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { TestStatus } from "./types.js";

export const FETCH_RCA_PARAMS = {
testId: z
.array(z.string())
.array(z.number().int())
.max(3)
.describe(
"Array of test IDs to fetch RCA data for (maximum 3 IDs). If not provided, use the listTestIds tool get all failed testcases. If more than 3 IDs are provided, only the first 3 will be processed.",
"Array of integer test IDs to fetch RCA data for (maximum 3 IDs). These must be numeric test IDs, not session IDs or strings. If not provided, use the listTestIds tool to get all failed testcases. If more than 3 IDs are provided, only the first 3 will be processed.",
),
};

Expand Down
8 changes: 4 additions & 4 deletions src/tools/rca-agent-utils/rca-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ async function updateProgress(
}

async function fetchInitialRCA(
testId: string,
testId: number,
headers: Record<string, string>,
baseUrl: string,
): Promise<RCATestCase> {
const url = baseUrl.replace("{testId}", testId);
const url = baseUrl.replace("{testId}", testId.toString());

try {
const response = await fetch(url, { headers });
Expand Down Expand Up @@ -179,7 +179,7 @@ async function pollRCAResults(
await Promise.allSettled(
inProgressCases.map(async (tc) => {
try {
const pollUrl = baseUrl.replace("{testId}", tc.id);
const pollUrl = baseUrl.replace("{testId}", tc.id.toString());
const response = await fetch(pollUrl, { headers });
if (!response.ok) {
const errorText = await response.text();
Expand Down Expand Up @@ -240,7 +240,7 @@ async function pollRCAResults(
}

export async function getRCAData(
testIds: string[],
testIds: number[],
authString: string,
context?: ScanProgressContext,
): Promise<RCAResponse> {
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rca-agent-utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface TestRun {
}

export interface FailedTestInfo {
test_id: string;
test_id: number;
test_name: string;
}

Expand All @@ -39,8 +39,8 @@ export enum RCAState {
}

export interface RCATestCase {
id: string;
testRunId: string;
id: number;
testRunId: number;
state: RCAState;
rcaData?: any;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rca-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function getBuildIdTool(

// Tool function that fetches RCA data
export async function fetchRCADataTool(
args: { testId: string[] },
args: { testId: number[] },
config: BrowserStackConfig,
): Promise<CallToolResult> {
try {
Expand Down