docs(agents): add Cursor Cloud environment setup notes - #296
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds a new "Cursor Cloud specific instructions" section to AGENTS.md, detailing VM environment configurations, toolchain behaviors (such as Bun versions), and testing guidelines. The review feedback suggests improving these instructions by recommending a future Dev Container configuration update to resolve Bun version conflicts, advising developers to limit Playwright workers to mitigate flaky tests in resource-constrained environments, and refining the phrasing regarding superduck CLI limitations to be more professional and technically precise.
|
|
||
| 面向在已跑过启动脚本(`bun install` + `go -C chrome-native-host mod download`)的云端环境里工作的后续代理。工具链(Bun、Go 1.25、golangci-lint、Playwright + Chromium 及其系统依赖)已固化在 VM 快照里,常规构建 / lint / test / run 命令见上文「构建命令」小节,这里只补充非显而易见的坑: | ||
|
|
||
| - **Bun 版本**:仓库根 `bun.lock` 用的是较新的 lockfile 格式,devcontainer 里 pin 的 `bun@1.1.42` 无法解析(报 `Unknown lockfile version`)。快照里装的是新版 Bun(`bun --version` 应 ≥ 1.3);不要降级到 1.1.42。 |
There was a problem hiding this comment.
虽然在文档中记录此问题对后续开发者很有帮助,但根本的解决办法是更新 Dev Container 配置文件(如 .devcontainer/devcontainer.json 或相关初始化脚本)中固定的 Bun 版本(例如升级到 1.2.0 或更高版本),以确保新拉取环境的用户不会遇到此问题。建议在后续 PR 中彻底修复该配置,并在本文档中补充说明。
| - **Bun 版本**:仓库根 `bun.lock` 用的是较新的 lockfile 格式,devcontainer 里 pin 的 `bun@1.1.42` 无法解析(报 `Unknown lockfile version`)。快照里装的是新版 Bun(`bun --version` 应 ≥ 1.3);不要降级到 1.1.42。 | |
| - **Bun 版本**: 仓库根目录的 bun.lock 采用了较新的 lockfile 格式(Bun 1.2+),而 Dev Container 中固定的 bun@1.1.42 无法解析该格式(会报错 Unknown lockfile version)。云端快照中已预装新版 Bun(bun --version 应 ≥ 1.3),请勿降级至 1.1.42。*(注:建议后续直接更新 Dev Container 配置文件以彻底解决此版本冲突)* |
|
|
||
| - **Bun 版本**:仓库根 `bun.lock` 用的是较新的 lockfile 格式,devcontainer 里 pin 的 `bun@1.1.42` 无法解析(报 `Unknown lockfile version`)。快照里装的是新版 Bun(`bun --version` 应 ≥ 1.3);不要降级到 1.1.42。 | ||
| - **扩展没有本地 dev server**:`bun run dev` 只是 `vite build --watch`,产物写进 `chrome-crx/dist/`。要在真实浏览器里验证得把 `dist/` 作为「加载已解压的扩展」载入 Chrome。 | ||
| - **端到端验证扩展**:`cd chrome-crx && bun run test:e2e` 会用 Playwright 把真实的 `dist/` 加载进**完整版 Chromium**(不是 `chrome-headless-shell`,后者会静默禁用 `--load-extension`)。用 `SKIP_BUILD=1 bun run test:e2e` 复用已有 `dist/` 跳过重复构建。少数 `p0-*` / `06-browser-batch` 用例在并行满载下偶发失败,但单独重跑必过——属已知 flaky,非环境问题。 |
There was a problem hiding this comment.
在云端 VM 等资源受限的环境中,并行运行测试极易因 CPU/内存争抢导致 flaky 失败。建议在此处补充说明:如果遇到此类偶发失败,可以通过限制 Playwright 的 worker 数量(例如追加 -- --workers=1)来降低并发,从而提高测试运行的稳定性。
| - **端到端验证扩展**:`cd chrome-crx && bun run test:e2e` 会用 Playwright 把真实的 `dist/` 加载进**完整版 Chromium**(不是 `chrome-headless-shell`,后者会静默禁用 `--load-extension`)。用 `SKIP_BUILD=1 bun run test:e2e` 复用已有 `dist/` 跳过重复构建。少数 `p0-*` / `06-browser-batch` 用例在并行满载下偶发失败,但单独重跑必过——属已知 flaky,非环境问题。 | |
| - **端到端验证扩展**: cd chrome-crx && bun run test:e2e 会用 Playwright 把真实的 dist/ 加载进完整版 Chromium(不是 chrome-headless-shell,后者会静默禁用 --load-extension)。用 SKIP_BUILD=1 bun run test:e2e 复用已有 dist/ 跳过重复构建。少数 p0-* / 06-browser-batch 用例在并行满载下偶发失败(属已知 flaky,非环境问题),在云端资源受限时,可尝试通过限制并发(如 bun run test:e2e -- --workers=1)来稳定运行。 |
| - **扩展没有本地 dev server**:`bun run dev` 只是 `vite build --watch`,产物写进 `chrome-crx/dist/`。要在真实浏览器里验证得把 `dist/` 作为「加载已解压的扩展」载入 Chrome。 | ||
| - **端到端验证扩展**:`cd chrome-crx && bun run test:e2e` 会用 Playwright 把真实的 `dist/` 加载进**完整版 Chromium**(不是 `chrome-headless-shell`,后者会静默禁用 `--load-extension`)。用 `SKIP_BUILD=1 bun run test:e2e` 复用已有 `dist/` 跳过重复构建。少数 `p0-*` / `06-browser-batch` 用例在并行满载下偶发失败,但单独重跑必过——属已知 flaky,非环境问题。 | ||
| - **Go 侧 lint**:`golangci-lint` 由 `make lint-install` 装到 `~/go/bin`(已在快照内),不在 PATH 时 `make lint` 会自动回退到该路径。 | ||
| - **superduck CLI 的完整链路**(CLI → native host → 已登录的真实 Chrome + 扩展 native messaging)在云端 VM 里没有接好;要端到端验证浏览器自动化,用上面的 Playwright e2e 套件,而不是 `chrome-native-host/testdata/` 里那些需要真实 Chrome 的冒烟脚本。 |
There was a problem hiding this comment.
“在云端 VM 里没有接好” 表述较为口语化。建议修改为更专业、准确的描述,并简要说明原因(如云端环境缺少 GUI 桌面及已登录的 Chrome 实例),以便后续开发者或 AI 代理更清晰地理解技术限制。
| - **superduck CLI 的完整链路**(CLI → native host → 已登录的真实 Chrome + 扩展 native messaging)在云端 VM 里没有接好;要端到端验证浏览器自动化,用上面的 Playwright e2e 套件,而不是 `chrome-native-host/testdata/` 里那些需要真实 Chrome 的冒烟脚本。 | |
| - **superduck CLI 的完整链路**(CLI → native host → 已登录的真实 Chrome + 扩展 native messaging)在云端无 GUI 的 VM 环境中无法直接运行(缺少真实的 Chrome 实例及登录态);若需端到端验证浏览器自动化,请使用上述 Playwright e2e 测试套件,而非 chrome-native-host/testdata/ 下依赖真实 Chrome 的本地冒烟脚本。 |
Summary
搭建并验证了本仓库在 Cursor 云端环境下的开发环境(Bun / Go 两个主要工作区),并把安装过程中发现的非显而易见坑记录进
AGENTS.md的## Cursor Cloud specific instructions,供后续云端代理复用。除文档外没有改动任何产品代码。Refs: dev environment setup
Type of change
Affected components
.github/workflows,scripts/,AGENTS.md, hooks)Implementation notes
bun install+go -C chrome-native-host mod download。AGENTS.md新增云端小节,记录的关键坑:bun.lock是较新 lockfile 格式,devcontainer pin 的bun@1.1.42无法解析,需用新版 Bun。bun run dev是 vite watch →dist/)。bun run test:e2e用 Playwright 把dist/加载进完整版 Chromium 做端到端验证;SKIP_BUILD=1复用已有dist/;个别p0-*/06-browser-batch用例并行下 flaky,单独重跑必过。Screenshots / recordings
在真实 Chromium 中加载构建好的扩展、打开 side panel 并完成一次「你好」对话(mock LLM)。
Verification
Tests added / updated
AGENTS.md说明)Security & privacy
.gitignorestill covers any newly produced artifacts.Reviewer checklist
AGENTS.md).