Skip to content

fix(ci): force reinstall node_modules when pnpm cache is corrupted#53245

Closed
w-sss wants to merge 1 commit intoopenclaw:mainfrom
w-sss:fix/ci-pnpm-cache
Closed

fix(ci): force reinstall node_modules when pnpm cache is corrupted#53245
w-sss wants to merge 1 commit intoopenclaw:mainfrom
w-sss:fix/ci-pnpm-cache

Conversation

@w-sss
Copy link
Copy Markdown
Contributor

@w-sss w-sss commented Mar 24, 2026

🐛 问题

CI 测试失败是因为 pnpm 缓存过期导致依赖缺失:

  • @anthropic-ai/vertex-sdk
  • matrix-js-sdk
  • openai 等

🔧 修复

添加 fallback 机制:当 pnpm install 失败时,删除 node_modules 并重新安装。

✅ 影响

  • 解决 check 失败
  • 解决 channels 测试失败
  • 解决 extensions 测试失败
  • 不影响现有功能

📝 测试

本地验证:

  • ✅ pnpm run check 通过
  • ✅ 依赖正确安装

- Add fallback to remove node_modules and reinstall if pnpm install fails
- Resolves missing dependency issues (@anthropic-ai/vertex-sdk, etc.)
- Fixes CI failures in check, channels, and extensions tests
@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR fixes a flaky Windows CI job (checks-windows) where a corrupted or incomplete pnpm store caused missing dependencies (@anthropic-ai/vertex-sdk, matrix-js-sdk, openai, etc.) and broke downstream test shards.

The previous fallback was a no-op — it retried the exact same command (--prefer-offline + same flags), so it would fail for the same reason. The new fallback removes node_modules and re-runs install without --prefer-offline, allowing pnpm to fetch the missing packages directly from the registry. --frozen-lockfile is correctly preserved in both attempts to maintain lockfile integrity.

Key details:

  • The defaults.run.shell: bash set at the job level makes rm -rf node_modules valid on the Windows runner.
  • The fallback is intentionally limited to this Windows job; Linux/macOS runners do not have this step at all (they rely on a different cache action setup).
  • One minor note: if the pnpm store itself (not just node_modules) is corrupted/partially written, the fallback still queries the store first before going to the network. In practice this covers the reported "missing package" case, but a fully corrupted store might need pnpm store prune as an additional step in future.

Confidence Score: 5/5

  • This PR is safe to merge — it's a targeted CI reliability fix with no impact on application code.
  • The change is minimal and well-scoped: it replaces an ineffective retry (same flags, same outcome) with a meaningful fallback that clears node_modules and fetches fresh from the registry. Shell compatibility is confirmed via the job-level bash default. --frozen-lockfile is preserved in both paths, so lockfile integrity is not compromised. No application logic is touched.
  • No files require special attention.

Reviews (1): Last reviewed commit: "fix(ci): force reinstall node_modules wh..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant