Use ranged reads and limited searches and fuzzy editing improvements (#19240)

This commit is contained in:
Christian Gunderman
2026-02-17 23:54:08 +00:00
committed by GitHub
parent 55c628e967
commit ce84b3cb5f
9 changed files with 1174 additions and 145 deletions
+14
View File
@@ -208,6 +208,7 @@ export interface ParsedLog {
stdout?: string;
stderr?: string;
error?: string;
prompt_id?: string;
};
scopeMetrics?: {
metrics: {
@@ -1051,6 +1052,7 @@ export class TestRig {
args: string;
success: boolean;
duration_ms: number;
prompt_id?: string;
};
}[] = [];
@@ -1079,6 +1081,13 @@ export class TestRig {
args = argsMatch[1];
}
// Look for prompt_id in the context
let promptId = undefined;
const promptIdMatch = context.match(/prompt_id:\s*'([^']+)'/);
if (promptIdMatch) {
promptId = promptIdMatch[1];
}
// Also try to find function_name to double-check
// Updated regex to handle tool names with hyphens and underscores
const nameMatch = context.match(/function_name:\s*'([\w-]+)'/);
@@ -1091,6 +1100,7 @@ export class TestRig {
args: args,
success: success,
duration_ms: duration,
prompt_id: promptId,
},
});
}
@@ -1138,6 +1148,7 @@ export class TestRig {
args: obj.attributes.function_args || '{}',
success: obj.attributes.success !== false,
duration_ms: obj.attributes.duration_ms || 0,
prompt_id: obj.attributes.prompt_id,
},
});
}
@@ -1152,6 +1163,7 @@ export class TestRig {
args: obj.attributes.function_args,
success: obj.attributes.success,
duration_ms: obj.attributes.duration_ms,
prompt_id: obj.attributes.prompt_id,
},
});
}
@@ -1242,6 +1254,7 @@ export class TestRig {
args: string;
success: boolean;
duration_ms: number;
prompt_id?: string;
};
}[] = [];
@@ -1258,6 +1271,7 @@ export class TestRig {
args: logData.attributes.function_args ?? '{}',
success: logData.attributes.success ?? false,
duration_ms: logData.attributes.duration_ms ?? 0,
prompt_id: logData.attributes.prompt_id,
},
});
}