← Back to PRs

#23129: build(deps): move @discordjs/opus to optionalDependencies

by Imccccc open 2026-02-22 02:04 View on GitHub →
channel: msteams commands agents size: S
Fixes #23121 Moved `@discordjs/opus` to `optionalDependencies` to prevent installation failures on systems without C/C++ build tools (like Raspberry Pi or standard Linux environments). Re-ran `pnpm install` to sync `pnpm-lock.yaml`. This ensures new users can install `openclaw@latest` successfully even without compilation prerequisites. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR bundles several changes together under a deps/build title but actually includes substantial feature additions: - **`@discordjs/opus` moved to `optionalDependencies`**: The core change from the PR title. The existing code in `src/discord/voice/manager.ts` already wraps the `require("@discordjs/opus")` in a try-catch, so this is a safe move that prevents installation failures on systems without C/C++ build tools. - **Gemini 3.1 Pro Preview model support**: Adds `gemini-3.1-pro-preview` and `gemini-3.1-pro-preview-customtools` across the model catalog fallback, OpenCode Zen static models, aliases, cost tables, context windows, and max tokens. Updates the default Gemini model from `gemini-3-pro-preview` to `gemini-3.1-pro-preview`. - **`@types/long` added to devDependencies** with `@ts-ignore` annotations on dynamic `import("long")` in macOS entry points to suppress TS resolver errors. - **`isLocalPath` hardened** in MSTeams media helpers with `path.isAbsolute()` and Windows long path (`\\?\`) support. - **Formatting/style fixes**: Line-length reformatting in `external-content.ts`, `web-tools.enabled-defaults.e2e.test.ts`, and `ci.yml` comment addition. - **Markdownlint config**: Added HTML table elements (`table`, `tr`, `td`, `th`, `thead`, `tbody`) to allowed elements. - **Test updates**: Adjusted `model-catalog.test.ts` assertions to use `arrayContaining` to accommodate fallback model injection, plus a new test for the Gemini 3.1 fallback. <h3>Confidence Score: 4/5</h3> - This PR is safe to merge — the core dependency change is well-guarded, and the model additions follow established patterns. - The `@discordjs/opus` move to optionalDependencies is safe since the import is already wrapped in try-catch. The Gemini 3.1 Pro Preview model additions are consistent across all relevant files and follow established patterns (aliases, costs, normalization, fallbacks, tests). Other changes are formatting fixes, `@ts-ignore` annotations for known TS resolver issues, and minor `isLocalPath` hardening. No logic bugs or security issues found. Score is 4 rather than 5 because the PR scope is much broader than the title suggests — it bundles a dependency change with a substantial feature (new model support) and several unrelated fixes. - `src/agents/model-catalog.ts` — new `applyGemini31PreviewFallback` function is the most significant logic addition and could benefit from reviewer attention to verify the hardcoded `contextWindow: 2000000` and `reasoning: true` values match Google's published specs. <sub>Last reviewed commit: 779f14b</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs