Skip to content

Commit 92039a5

Browse files
authored
Merge branch 'RooCodeInc:main' into fix/openrouter-gemini-2.5-pro-token-limit
2 parents cbf0fe3 + 1dcb6d4 commit 92039a5

Some content is hidden

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

43 files changed

+1448
-151
lines changed

.changeset/ready-guests-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Convert bootstrap script to esm

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,18 @@ body:
7171
- type: textarea
7272
id: what-happened
7373
attributes:
74-
label: 💥 Outcome Summary (Optional)
74+
label: 💥 Outcome Summary
7575
description: |
76-
Recap what went wrong in one or two lines. Use this if the bug is weird, unexpected, or needs extra context.
76+
Recap what went wrong in one or two lines.
7777
7878
Example: "Expected code to run, but got an empty response and no error."
7979
placeholder: Expected ___, but got ___.
80+
validations:
81+
required: true
8082

8183
- type: textarea
8284
id: logs
8385
attributes:
84-
label: 📄 Relevant Logs or Errors
86+
label: 📄 Relevant Logs or Errors (Optional)
8587
description: Paste API logs, terminal output, or errors here. Use triple backticks (```) for code formatting.
8688
render: shell

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Detail the steps to test your changes. This helps reviewers verify your work.
6161
- [ ] **Branch Hygiene**: My branch is up-to-date (rebased) with the `main` branch.
6262
- [ ] **Documentation Impact**: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
6363
- [ ] **Changeset**: A changeset has been created using `npm run changeset` if this PR includes user-facing changes or dependency updates.
64-
- [ ] **Contribution Guidelines**: I have read and agree to the [Contributor Guidelines](../CONTRIBUTING.md).
64+
- [ ] **Contribution Guidelines**: I have read and agree to the [Contributor Guidelines](/CONTRIBUTING.md).
6565

6666
### Screenshots / Videos
6767

.husky/pre-commit

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ fi
99
if [ "$OS" = "Windows_NT" ]; then
1010
pnpm_cmd="pnpm.cmd"
1111
else
12-
pnpm_cmd="pnpm"
12+
if command -v pnpm >/dev/null 2>&1; then
13+
pnpm_cmd="pnpm"
14+
else
15+
pnpm_cmd="npx pnpm"
16+
fi
1317
fi
1418

15-
"$pnpm_cmd" --filter roo-cline generate-types
19+
$pnpm_cmd --filter roo-cline generate-types
1620

1721
if [ -n "$(git diff --name-only src/exports/roo-code.d.ts)" ]; then
1822
echo "Error: There are unstaged changes to roo-code.d.ts after running 'pnpm --filter roo-cline generate-types'."
@@ -27,5 +31,5 @@ else
2731
npx_cmd="npx"
2832
fi
2933

30-
"$npx_cmd" lint-staged
31-
"$pnpm_cmd" lint
34+
$npx_cmd lint-staged
35+
$pnpm_cmd lint

.husky/pre-push

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ fi
99
if [ "$OS" = "Windows_NT" ]; then
1010
pnpm_cmd="pnpm.cmd"
1111
else
12-
pnpm_cmd="pnpm"
12+
if command -v pnpm >/dev/null 2>&1; then
13+
pnpm_cmd="pnpm"
14+
else
15+
pnpm_cmd="npx pnpm"
16+
fi
1317
fi
1418

15-
"$pnpm_cmd" run check-types
19+
$pnpm_cmd run check-types
1620

1721
# Check for new changesets.
1822
NEW_CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ')

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55
"node": "20.18.1"
66
},
77
"scripts": {
8-
"preinstall": "npx only-allow pnpm",
8+
"preinstall": "node scripts/bootstrap.mjs",
99
"prepare": "husky",
10+
"install": "node scripts/bootstrap.mjs",
11+
"install:all": "node scripts/bootstrap.mjs",
1012
"lint": "turbo lint --log-order grouped --output-logs new-only",
1113
"check-types": "turbo check-types --log-order grouped --output-logs new-only",
1214
"test": "turbo test --log-order grouped --output-logs new-only",
1315
"format": "turbo format --log-order grouped --output-logs new-only",
1416
"clean": "turbo clean --log-order grouped --output-logs new-only && rimraf dist out bin .vite-port .turbo",
1517
"build": "pnpm --filter roo-cline vsix",
18+
"compile": "pnpm --filter roo-cline bundle",
19+
"vsix": "pnpm --filter roo-cline vsix",
1620
"build:nightly": "pnpm --filter @roo-code/vscode-nightly vsix",
1721
"generate-types": "pnpm --filter roo-cline generate-types",
1822
"changeset:version": "cp CHANGELOG.md src/CHANGELOG.md && changeset version && cp -vf src/CHANGELOG.md .",

scripts/bootstrap.mjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env node
2+
3+
import { spawnSync } from "child_process"
4+
import { existsSync, writeFileSync } from "fs"
5+
6+
if (process.env.BOOTSTRAP_IN_PROGRESS) {
7+
console.log("⏭️ Bootstrap already in progress, continuing with normal installation...")
8+
process.exit(0)
9+
}
10+
11+
// If we're already using pnpm, just exit normally.
12+
if (process.env.npm_execpath && process.env.npm_execpath.includes("pnpm")) {
13+
process.exit(0)
14+
}
15+
16+
console.log("🚀 Bootstrapping to pnpm...")
17+
18+
/**
19+
* Run pnpm install with bootstrap environment variable.
20+
*/
21+
function runPnpmInstall(pnpmCommand) {
22+
return spawnSync(pnpmCommand, ["install"], {
23+
stdio: "inherit",
24+
shell: true,
25+
env: {
26+
...process.env,
27+
BOOTSTRAP_IN_PROGRESS: "1", // Set environment variable to indicate bootstrapping
28+
},
29+
})
30+
}
31+
32+
/**
33+
* Create a temporary package.json if it doesn't exist.
34+
*/
35+
function ensurePackageJson() {
36+
if (!existsSync("package.json")) {
37+
console.log("📦 Creating temporary package.json...")
38+
writeFileSync("package.json", JSON.stringify({ name: "temp", private: true }, null, 2))
39+
}
40+
}
41+
42+
try {
43+
// Check if pnpm is installed globally.
44+
const pnpmCheck = spawnSync("command", ["-v", "pnpm"], { shell: true })
45+
46+
let pnpmInstall
47+
48+
if (pnpmCheck.status === 0) {
49+
console.log("✨ Found pnpm")
50+
pnpmInstall = runPnpmInstall("pnpm")
51+
} else {
52+
console.log("⚠️ Unable to find pnpm, installing it temporarily...")
53+
ensurePackageJson()
54+
55+
console.log("📥 Installing pnpm locally...")
56+
57+
const npmInstall = spawnSync("npm", ["install", "--no-save", "pnpm"], {
58+
stdio: "inherit",
59+
shell: true,
60+
})
61+
62+
if (npmInstall.status !== 0) {
63+
console.error("❌ Failed to install pnpm locally")
64+
process.exit(1)
65+
}
66+
67+
console.log("🔧 Running pnpm install with local installation...")
68+
pnpmInstall = runPnpmInstall("node_modules/.bin/pnpm")
69+
}
70+
71+
if (pnpmInstall.status !== 0) {
72+
console.error("❌ pnpm install failed")
73+
process.exit(pnpmInstall.status)
74+
}
75+
76+
console.log("🎉 Bootstrap completed successfully!")
77+
process.exit(0)
78+
} catch (error) {
79+
console.error("💥 Bootstrap failed:", error.message)
80+
process.exit(1)
81+
}

src/api/providers/bedrock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
499499
})
500500

501501
return {
502-
system: systemMessage ? [{ text: systemMessage } as SystemContentBlock] : [],
502+
system: cacheResult.system,
503503
messages: messagesWithCache,
504504
}
505505
}

0 commit comments

Comments
 (0)