Skip to content

Commit 8470280

Browse files
committed
It's working
1 parent 76e6e59 commit 8470280

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

benchmark/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ RUN /home/vscode/.local/bin/uv sync
5454

5555
WORKDIR /home/vscode/repo/benchmark
5656

57-
# Copy & install extension
58-
COPY --chown=vscode:vscode ./bin/roo-code-latest.vsix ./
59-
RUN code --debug --install-extension ./roo-code-latest.vsix
60-
6157
# Install dependencies
6258
COPY --chown=vscode:vscode ./benchmark/package.json ./benchmark/pnpm-lock.yaml ./benchmark/pnpm-workspace.yaml ./benchmark/.npmrc ./
6359
RUN mkdir -p apps/cli apps/web \
@@ -73,6 +69,10 @@ COPY --chown=vscode:vscode ./benchmark/packages/lib/package.json ./packages
7369
COPY --chown=vscode:vscode ./benchmark/packages/types/package.json ./packages/types/
7470
RUN pnpm install
7571

72+
# Copy & install extension
73+
COPY --chown=vscode:vscode ./bin/roo-code-latest.vsix ./
74+
RUN code --debug --install-extension ./roo-code-latest.vsix
75+
7676
# Copy application code
7777
COPY --chown=vscode:vscode ./benchmark ./
7878

benchmark/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Build the Roo Code extension:
2929
```sh
3030
npm run install:all
3131
npx vsce package --out bin/roo-code-latest.vsix
32+
code --install-extension bin/roo-code-latest.vsix
3233
```
3334

3435
[Install](https://docs.docker.com/desktop/) and run Docker Desktop.

benchmark/apps/cli/src/index.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { __dirname, extensionDevelopmentPath, exercisesPath } from "./paths.js"
3434
import { getExercises } from "./exercises.js"
3535

3636
const maxConcurrency = 2
37-
const taskTimeLimit = 2 * 60 * 1_000
37+
const taskTimeLimit = 5 * 60 * 1_000
3838

3939
const testCommands: Record<ExerciseLanguage, { commands: string[]; timeout?: number; cwd?: string }> = {
4040
cpp: { commands: ["cmake -G 'Unix\\ Makefiles' -DEXERCISM_RUN_ALL_TESTS=1 ..", "make"], cwd: "build" }, // timeout 15s bash -c "cd '$dir' && mkdir -p build && cd build && cmake -G 'Unix Makefiles' -DEXERCISM_RUN_ALL_TESTS=1 .. >/dev/null 2>&1 && make >/dev/null 2>&1"
@@ -94,8 +94,8 @@ const run = async (toolbox: GluegunToolbox) => {
9494
throw new Error("No tasks found.")
9595
}
9696

97-
console.log(await execa({ cwd: exercisesPath })`git config --global user.name "Roo Code"`)
98-
console.log(await execa({ cwd: exercisesPath })`git config --global user.email "[email protected]"`)
97+
console.log(await execa({ cwd: exercisesPath })`git config user.name "Roo Code"`)
98+
console.log(await execa({ cwd: exercisesPath })`git config user.email "[email protected]"`)
9999
console.log(await execa({ cwd: exercisesPath })`git checkout -f`)
100100
console.log(await execa({ cwd: exercisesPath })`git clean -fd`)
101101
console.log(await execa({ cwd: exercisesPath })`git checkout -b runs/${run.id} main`)
@@ -170,11 +170,12 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server
170170
const cancelSignal = controller.signal
171171

172172
// If debugging:
173-
// Use --log trace or --verbose.
174-
let codeCommand = `code --wait --log trace --disable-workspace-trust`
173+
// Use --wait --log trace or --verbose.
174+
let codeCommand = `code --disable-workspace-trust`
175+
const isDocker = fs.existsSync("/.dockerenv")
175176

176-
if (fs.existsSync("/.dockerenv")) {
177-
codeCommand = `xvfb-run --auto-servernum --server-num=1 ${codeCommand} --disable-gpu --password-store="basic"`
177+
if (isDocker) {
178+
codeCommand = `xvfb-run --auto-servernum --server-num=1 ${codeCommand} --wait --log trace --disable-gpu --password-store="basic"`
178179
}
179180

180181
const subprocess = execa({
@@ -189,7 +190,7 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server
189190
// subprocess.stdout.pipe(process.stdout)
190191

191192
// Give VSCode some time to spawn before connectint to its unix socket.
192-
await new Promise((resolve) => setTimeout(resolve, 2_000))
193+
await new Promise((resolve) => setTimeout(resolve, isDocker ? 5_000 : 1_000))
193194
console.log(`Connecting to ${taskSocketPath} (pid: ${subprocess.pid})`)
194195

195196
const createClient = (taskSocketPath: string) => {
@@ -207,7 +208,7 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server
207208

208209
while (++tries < 5) {
209210
try {
210-
await pWaitFor(() => client.isReady, { interval: 100, timeout: 2_000 })
211+
await pWaitFor(() => client.isReady, { interval: 100, timeout: 5_000 })
211212
break
212213
} catch (error) {
213214
console.error(error)
@@ -227,8 +228,8 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server
227228

228229
const ignoreEvents: RooCodeEventName[] = [
229230
RooCodeEventName.Message,
230-
RooCodeEventName.TaskTokenUsageUpdated,
231-
RooCodeEventName.TaskAskResponded,
231+
// RooCodeEventName.TaskTokenUsageUpdated,
232+
// RooCodeEventName.TaskAskResponded,
232233
]
233234

234235
let taskStartedAt = Date.now()

benchmark/packages/types/src/roo-code-defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const rooCodeDefaults: RooCodeSettings = {
4141
maxReadFileLine: 500,
4242

4343
terminalOutputLineLimit: 500,
44-
terminalShellIntegrationTimeout: 5000,
44+
terminalShellIntegrationTimeout: 15000,
4545

4646
rateLimitSeconds: 0,
4747
diffEnabled: true,

src/integrations/terminal/Terminal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import pWaitFor from "p-wait-for"
33
import { ExitCodeDetails, mergePromise, TerminalProcess, TerminalProcessResultPromise } from "./TerminalProcess"
44
import { truncateOutput, applyRunLengthEncoding } from "../misc/extract-text"
55

6-
export const TERMINAL_SHELL_INTEGRATION_TIMEOUT = 5000
6+
export const TERMINAL_SHELL_INTEGRATION_TIMEOUT = 15_000
77

88
export class Terminal {
99
private static shellIntegrationTimeout: number = TERMINAL_SHELL_INTEGRATION_TIMEOUT
@@ -186,7 +186,7 @@ export class Terminal {
186186
console.log(`[Terminal ${this.id}] Shell integration not available. Command execution aborted.`)
187187
process.emit(
188188
"no_shell_integration",
189-
"Shell integration initialization sequence '\\x1b]633;A' was not received within 4 seconds. Shell integration has been disabled for this terminal instance. Increase the timeout in the settings if necessary.",
189+
`Shell integration initialization sequence '\\x1b]633;A' was not received within ${Terminal.shellIntegrationTimeout / 1000}s. Shell integration has been disabled for this terminal instance. Increase the timeout in the settings if necessary.`,
190190
)
191191
})
192192
})

0 commit comments

Comments
 (0)