Skip to content

Commit e050043

Browse files
authored
Typos + promisify exec calls (#2243)
1 parent d15f813 commit e050043

File tree

4 files changed

+36
-27
lines changed

4 files changed

+36
-27
lines changed

e2e/src/suite/task.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ suite("Roo Code Task", () => {
2323

2424
await waitUntilCompleted({ api, taskId })
2525

26-
const completion = messages.find(({ say, partial }) => say === "completion_result")
27-
2826
assert.ok(
29-
completion?.text?.includes("My name is Roo"),
30-
`Completion should include "My name is Roo" - ${completion?.text}`,
27+
!!messages.find(
28+
({ say, text }) => (say === "completion_result" || say === "text") && text?.includes("My name is Roo"),
29+
),
30+
`Completion should include "My name is Roo"`,
3131
)
3232
})
3333
})

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function SettingsDiff({
2828
const isDefault = JSON.stringify(defaultValue) === JSON.stringify(customValue)
2929

3030
return isDefault ? null : (
31-
<SetttingDiff
31+
<SettingDiff
3232
key={key}
3333
name={key}
3434
defaultValue={JSON.stringify(defaultValue, null, 2)}
@@ -46,7 +46,7 @@ type SettingDiffProps = HTMLAttributes<HTMLDivElement> & {
4646
customValue?: string
4747
}
4848

49-
export function SetttingDiff({ name, defaultValue, customValue, ...props }: SettingDiffProps) {
49+
export function SettingDiff({ name, defaultValue, customValue, ...props }: SettingDiffProps) {
5050
return (
5151
<Fragment {...props}>
5252
<div className="overflow-hidden font-mono">{name}</div>

evals/apps/web/src/lib/server/processes.ts

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,33 @@
33
import psTree from "ps-tree"
44
import { exec } from "child_process"
55

6-
export const getProcessList = async (pid: number) => {
7-
const promise = new Promise<string>((resolve, reject) => {
8-
exec(`ps -p ${pid} -o pid=`, (err, stdout, stderr) => {
9-
if (err) {
10-
reject(stderr)
6+
const asyncExec = (command: string): Promise<{ stdout: string; stderr: string }> =>
7+
new Promise((resolve, reject) => {
8+
exec(command, (error, stdout, stderr) => {
9+
if (error) {
10+
reject(error)
11+
} else {
12+
resolve({ stdout, stderr })
1113
}
12-
13-
resolve(stdout)
1414
})
1515
})
1616

17+
export const getProcessList = async (pid: number) => {
1718
try {
18-
await promise
19-
} catch (_) {
20-
return null
21-
}
19+
await asyncExec(`ps -p ${pid} -o pid=`)
2220

23-
return new Promise<number[]>((resolve, reject) => {
24-
psTree(pid, (err, children) => {
25-
if (err) {
26-
reject(err)
27-
}
21+
return new Promise<number[]>((resolve, reject) => {
22+
psTree(pid, (err, children) => {
23+
if (err) {
24+
reject(err)
25+
}
2826

29-
resolve(children.map((p) => parseInt(p.PID)))
27+
resolve(children.map((p) => parseInt(p.PID)))
28+
})
3029
})
31-
})
30+
} catch (_) {
31+
return null
32+
}
3233
}
3334

3435
export const killProcessTree = async (pid: number) => {
@@ -39,8 +40,16 @@ export const killProcessTree = async (pid: number) => {
3940
}
4041

4142
if (descendants.length > 0) {
42-
await exec(`kill -9 ${descendants.join(" ")}`)
43+
try {
44+
await asyncExec(`kill -9 ${descendants.join(" ")}`)
45+
} catch (error) {
46+
console.error("Error killing descendant processes:", error)
47+
}
4348
}
4449

45-
await exec(`kill -9 ${pid}`)
50+
try {
51+
await asyncExec(`kill -9 ${pid}`)
52+
} catch (error) {
53+
console.error("Error killing main process:", error)
54+
}
4655
}

evals/packages/db/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Update `src/schema.ts` as needed, and then run:
66
pnpm db:generate
77
```
88

9-
Inspect the generated sql in the migration filed added to `drizzle/`.
9+
Inspect the sql in the migration file added to `drizzle/`.
1010

1111
If it looks okay, then run:
1212

0 commit comments

Comments
 (0)