Chris Estreich 9 месяцев назад
Родитель
Сommit
e050043e58

+ 4 - 4
e2e/src/suite/task.test.ts

@@ -23,11 +23,11 @@ suite("Roo Code Task", () => {
 
 		await waitUntilCompleted({ api, taskId })
 
-		const completion = messages.find(({ say, partial }) => say === "completion_result")
-
 		assert.ok(
-			completion?.text?.includes("My name is Roo"),
-			`Completion should include "My name is Roo" - ${completion?.text}`,
+			!!messages.find(
+				({ say, text }) => (say === "completion_result" || say === "text") && text?.includes("My name is Roo"),
+			),
+			`Completion should include "My name is Roo"`,
 		)
 	})
 })

+ 2 - 2
evals/apps/web/src/app/runs/new/settings-diff.tsx

@@ -28,7 +28,7 @@ export function SettingsDiff({
 				const isDefault = JSON.stringify(defaultValue) === JSON.stringify(customValue)
 
 				return isDefault ? null : (
-					<SetttingDiff
+					<SettingDiff
 						key={key}
 						name={key}
 						defaultValue={JSON.stringify(defaultValue, null, 2)}
@@ -46,7 +46,7 @@ type SettingDiffProps = HTMLAttributes<HTMLDivElement> & {
 	customValue?: string
 }
 
-export function SetttingDiff({ name, defaultValue, customValue, ...props }: SettingDiffProps) {
+export function SettingDiff({ name, defaultValue, customValue, ...props }: SettingDiffProps) {
 	return (
 		<Fragment {...props}>
 			<div className="overflow-hidden font-mono">{name}</div>

+ 29 - 20
evals/apps/web/src/lib/server/processes.ts

@@ -3,32 +3,33 @@
 import psTree from "ps-tree"
 import { exec } from "child_process"
 
-export const getProcessList = async (pid: number) => {
-	const promise = new Promise<string>((resolve, reject) => {
-		exec(`ps -p ${pid} -o pid=`, (err, stdout, stderr) => {
-			if (err) {
-				reject(stderr)
+const asyncExec = (command: string): Promise<{ stdout: string; stderr: string }> =>
+	new Promise((resolve, reject) => {
+		exec(command, (error, stdout, stderr) => {
+			if (error) {
+				reject(error)
+			} else {
+				resolve({ stdout, stderr })
 			}
-
-			resolve(stdout)
 		})
 	})
 
+export const getProcessList = async (pid: number) => {
 	try {
-		await promise
-	} catch (_) {
-		return null
-	}
+		await asyncExec(`ps -p ${pid} -o pid=`)
 
-	return new Promise<number[]>((resolve, reject) => {
-		psTree(pid, (err, children) => {
-			if (err) {
-				reject(err)
-			}
+		return new Promise<number[]>((resolve, reject) => {
+			psTree(pid, (err, children) => {
+				if (err) {
+					reject(err)
+				}
 
-			resolve(children.map((p) => parseInt(p.PID)))
+				resolve(children.map((p) => parseInt(p.PID)))
+			})
 		})
-	})
+	} catch (_) {
+		return null
+	}
 }
 
 export const killProcessTree = async (pid: number) => {
@@ -39,8 +40,16 @@ export const killProcessTree = async (pid: number) => {
 	}
 
 	if (descendants.length > 0) {
-		await exec(`kill -9 ${descendants.join(" ")}`)
+		try {
+			await asyncExec(`kill -9 ${descendants.join(" ")}`)
+		} catch (error) {
+			console.error("Error killing descendant processes:", error)
+		}
 	}
 
-	await exec(`kill -9 ${pid}`)
+	try {
+		await asyncExec(`kill -9 ${pid}`)
+	} catch (error) {
+		console.error("Error killing main process:", error)
+	}
 }

+ 1 - 1
evals/packages/db/README.md

@@ -6,7 +6,7 @@ Update `src/schema.ts` as needed, and then run:
 pnpm db:generate
 ```
 
-Inspect the generated sql in the migration filed added to `drizzle/`.
+Inspect the sql in the migration file added to `drizzle/`.
 
 If it looks okay, then run: