Skip to content

Commit 3ca31b1

Browse files
authored
Merge branch 'main' into historyItem
2 parents 37bd655 + 483d951 commit 3ca31b1

File tree

139 files changed

+2725
-526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+2725
-526
lines changed

.changeset/metal-suns-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-code": patch
3+
---
4+
5+
Bug fix for trailing slash error when using LiteLLM provider
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 'Slack Notification'
2+
description: 'Send Slack notification for workflow failures'
3+
inputs:
4+
webhook-url:
5+
description: 'Slack webhook URL'
6+
required: true
7+
channel:
8+
description: 'Slack channel to notify'
9+
required: true
10+
workflow-name:
11+
description: 'Name of the workflow'
12+
required: true
13+
failed-jobs:
14+
description: 'JSON object containing job results'
15+
required: true
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Parse failed jobs
21+
id: parse-jobs
22+
shell: bash
23+
run: |
24+
echo "Parsing job results..."
25+
failed_list=""
26+
27+
# Parse the JSON and extract failed jobs
28+
echo '${{ inputs.failed-jobs }}' | jq -r 'to_entries[] | select(.value.result == "failure") | .key' | while read job; do
29+
case $job in
30+
"check-translations") failed_list="${failed_list}❌ Translation check\n" ;;
31+
"knip") failed_list="${failed_list}❌ Knip analysis\n" ;;
32+
"compile") failed_list="${failed_list}❌ Compile & lint\n" ;;
33+
"platform-unit-test") failed_list="${failed_list}❌ Unit tests\n" ;;
34+
"integration-test") failed_list="${failed_list}❌ Integration tests\n" ;;
35+
esac
36+
done
37+
38+
# Remove trailing newline and save to output
39+
echo "failed_jobs<<EOF" >> $GITHUB_OUTPUT
40+
echo -e "$failed_list" | sed '/^$/d' >> $GITHUB_OUTPUT
41+
echo "EOF" >> $GITHUB_OUTPUT
42+
43+
- name: Send Slack notification
44+
uses: 8398a7/action-slack@v3
45+
with:
46+
status: failure
47+
channel: ${{ inputs.channel }}
48+
text: |
49+
🚨 ${{ inputs.workflow-name }} workflow failed on main branch!
50+
51+
Repository: ${{ github.repository }}
52+
Commit: ${{ github.sha }}
53+
Author: ${{ github.actor }}
54+
55+
Failed jobs:
56+
${{ steps.parse-jobs.outputs.failed_jobs }}
57+
58+
View details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
59+
env:
60+
SLACK_WEBHOOK_URL: ${{ inputs.webhook-url }}

.github/workflows/code-qa.yml

Lines changed: 92 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,102 @@
11
name: Code QA Roo Code
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches: [main]
7-
pull_request:
8-
types: [opened, reopened, ready_for_review, synchronize]
9-
branches: [main]
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
types: [opened, reopened, ready_for_review, synchronize]
9+
branches: [main]
1010

1111
jobs:
12-
check-translations:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
17-
- name: Setup Node.js and pnpm
18-
uses: ./.github/actions/setup-node-pnpm
19-
- name: Verify all translations are complete
20-
run: node scripts/find-missing-translations.js
12+
check-translations:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Setup Node.js and pnpm
18+
uses: ./.github/actions/setup-node-pnpm
19+
- name: Verify all translations are complete
20+
run: node scripts/find-missing-translations.js
2121

22-
knip:
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Checkout code
26-
uses: actions/checkout@v4
27-
- name: Setup Node.js and pnpm
28-
uses: ./.github/actions/setup-node-pnpm
29-
- name: Run knip checks
30-
run: pnpm knip
22+
knip:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
- name: Setup Node.js and pnpm
28+
uses: ./.github/actions/setup-node-pnpm
29+
- name: Run knip checks
30+
run: pnpm knip
3131

32-
compile:
33-
runs-on: ubuntu-latest
34-
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v4
37-
- name: Setup Node.js and pnpm
38-
uses: ./.github/actions/setup-node-pnpm
39-
- name: Lint
40-
run: pnpm lint
41-
- name: Check types
42-
run: pnpm check-types
32+
compile:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
- name: Setup Node.js and pnpm
38+
uses: ./.github/actions/setup-node-pnpm
39+
- name: Lint
40+
run: pnpm lint
41+
- name: Check types
42+
run: pnpm check-types
4343

44-
platform-unit-test:
45-
runs-on: ${{ matrix.os }}
46-
strategy:
47-
matrix:
48-
os: [ubuntu-latest, windows-latest]
49-
steps:
50-
- name: Checkout code
51-
uses: actions/checkout@v4
52-
- name: Setup Node.js and pnpm
53-
uses: ./.github/actions/setup-node-pnpm
54-
- name: Run unit tests
55-
run: pnpm test
44+
platform-unit-test:
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
os: [ubuntu-latest, windows-latest]
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
- name: Setup Node.js and pnpm
53+
uses: ./.github/actions/setup-node-pnpm
54+
- name: Run unit tests
55+
run: pnpm test
5656

57-
check-openrouter-api-key:
58-
runs-on: ubuntu-latest
59-
outputs:
60-
exists: ${{ steps.openrouter-api-key-check.outputs.defined }}
61-
steps:
62-
- name: Check if OpenRouter API key exists
63-
id: openrouter-api-key-check
64-
shell: bash
65-
run: |
66-
if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then
67-
echo "defined=true" >> $GITHUB_OUTPUT;
68-
else
69-
echo "defined=false" >> $GITHUB_OUTPUT;
70-
fi
57+
check-openrouter-api-key:
58+
runs-on: ubuntu-latest
59+
outputs:
60+
exists: ${{ steps.openrouter-api-key-check.outputs.defined }}
61+
steps:
62+
- name: Check if OpenRouter API key exists
63+
id: openrouter-api-key-check
64+
shell: bash
65+
run: |
66+
if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then
67+
echo "defined=true" >> $GITHUB_OUTPUT;
68+
else
69+
echo "defined=false" >> $GITHUB_OUTPUT;
70+
fi
7171
72-
integration-test:
73-
runs-on: ubuntu-latest
74-
needs: [check-openrouter-api-key]
75-
if: needs.check-openrouter-api-key.outputs.exists == 'true'
76-
steps:
77-
- name: Checkout code
78-
uses: actions/checkout@v4
79-
- name: Setup Node.js and pnpm
80-
uses: ./.github/actions/setup-node-pnpm
81-
- name: Create .env.local file
82-
working-directory: apps/vscode-e2e
83-
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local
84-
- name: Run integration tests
85-
working-directory: apps/vscode-e2e
86-
run: xvfb-run -a pnpm test:ci
72+
integration-test:
73+
runs-on: ubuntu-latest
74+
needs: [check-openrouter-api-key]
75+
if: needs.check-openrouter-api-key.outputs.exists == 'true'
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v4
79+
- name: Setup Node.js and pnpm
80+
uses: ./.github/actions/setup-node-pnpm
81+
- name: Create .env.local file
82+
working-directory: apps/vscode-e2e
83+
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local
84+
- name: Run integration tests
85+
working-directory: apps/vscode-e2e
86+
run: xvfb-run -a pnpm test:ci
87+
88+
notify-slack-on-failure:
89+
runs-on: ubuntu-latest
90+
needs: [check-translations, knip, compile, platform-unit-test, integration-test]
91+
if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(needs.*.result, 'failure') }}
92+
steps:
93+
- name: Checkout code
94+
uses: actions/checkout@v4
95+
96+
- name: Send Slack notification on failure
97+
uses: ./.github/actions/slack-notify
98+
with:
99+
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
100+
channel: "#ci"
101+
workflow-name: "Code QA"
102+
failed-jobs: ${{ toJSON(needs) }}

.github/workflows/nightly-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
publish-nightly:
1313
runs-on: ubuntu-latest
14-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
1515

1616
permissions:
1717
contents: read # No tags pushed → read is enough.

apps/web-evals/src/actions/runs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ export async function createRun({ suite, exercises = [], systemPrompt, ...values
5252

5353
const dockerArgs = [
5454
`--name evals-controller-${run.id}`,
55-
"--rm",
55+
// "--rm",
5656
"--network evals_default",
5757
"-v /var/run/docker.sock:/var/run/docker.sock",
58+
"-v /tmp/evals:/var/log/evals",
5859
"-e HOST_EXECUTION_METHOD=docker",
5960
]
6061

packages/build/src/esbuild.ts

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as fs from "fs"
22
import * as path from "path"
3+
import { execSync } from "child_process"
34

45
import { ViewsContainer, Views, Menus, Configuration, contributesSchema } from "./types.js"
56

@@ -22,23 +23,50 @@ function copyDir(srcDir: string, dstDir: string, count: number): number {
2223
return count
2324
}
2425

25-
function rmDir(dirPath: string, maxRetries: number = 3): void {
26+
function rmDir(dirPath: string, maxRetries: number = 5): void {
2627
for (let attempt = 1; attempt <= maxRetries; attempt++) {
2728
try {
2829
fs.rmSync(dirPath, { recursive: true, force: true })
2930
return
3031
} catch (error) {
3132
const isLastAttempt = attempt === maxRetries
3233

33-
const isEnotemptyError =
34-
error instanceof Error && "code" in error && (error.code === "ENOTEMPTY" || error.code === "EBUSY")
34+
const isRetryableError =
35+
error instanceof Error &&
36+
"code" in error &&
37+
(error.code === "ENOTEMPTY" ||
38+
error.code === "EBUSY" ||
39+
error.code === "EPERM" ||
40+
error.code === "EACCES")
41+
42+
if (isLastAttempt) {
43+
// On the last attempt, try alternative cleanup methods.
44+
try {
45+
console.warn(`[rmDir] Final attempt using alternative cleanup for ${dirPath}`)
46+
47+
// Try to clear readonly flags on Windows.
48+
if (process.platform === "win32") {
49+
try {
50+
execSync(`attrib -R "${dirPath}\\*.*" /S /D`, { stdio: "ignore" })
51+
} catch {
52+
// Ignore attrib errors.
53+
}
54+
}
55+
fs.rmSync(dirPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 })
56+
return
57+
} catch (finalError) {
58+
console.error(`[rmDir] Failed to remove ${dirPath} after ${maxRetries} attempts:`, finalError)
59+
throw finalError
60+
}
61+
}
3562

36-
if (isLastAttempt || !isEnotemptyError) {
37-
throw error // Re-throw if it's the last attempt or not a locking error.
63+
if (!isRetryableError) {
64+
throw error // Re-throw if it's not a retryable error.
3865
}
3966

40-
// Wait with exponential backoff before retrying.
41-
const delay = Math.min(100 * Math.pow(2, attempt - 1), 1000) // Cap at 1s.
67+
// Wait with exponential backoff before retrying, with longer delays for Windows.
68+
const baseDelay = process.platform === "win32" ? 200 : 100
69+
const delay = Math.min(baseDelay * Math.pow(2, attempt - 1), 2000) // Cap at 2s
4270
console.warn(`[rmDir] Attempt ${attempt} failed for ${dirPath}, retrying in ${delay}ms...`)
4371

4472
// Synchronous sleep for simplicity in build scripts.

packages/cloud/src/AuthService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { CloudUserInfo } from "@roo-code/types"
99

1010
import { getClerkBaseUrl, getRooCodeApiUrl } from "./Config"
1111
import { RefreshTimer } from "./RefreshTimer"
12+
import { getUserAgent } from "./utils"
1213

1314
export interface AuthServiceEvents {
1415
"inactive-session": [data: { previousState: AuthState }]
@@ -435,7 +436,7 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
435436
}
436437

437438
private userAgent(): string {
438-
return `Roo-Code ${this.context.extension?.packageJSON?.version}`
439+
return getUserAgent(this.context)
439440
}
440441

441442
private static _instance: AuthService | null = null

0 commit comments

Comments
 (0)