#23129: build(deps): move @discordjs/opus to optionalDependencies
channel: msteams
commands
agents
size: S
Cluster:
Gemini Provider Enhancements
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
#21181: fix(models): add gemini-3.1-pro-preview forward-compat for google-g...
by Mellowambience · 2026-02-19
80.4%
#23424: feat: add Gemini 3.1 Pro Preview support (google-gemini-cli)
by hongchanroh · 2026-02-22
79.6%
#17701: fix(memory-lancedb): add gemini-embedding-001 and baseUrl support
by Phineas1500 · 2026-02-16
78.8%
#23034: Add Gemini 3.1 Pro to Google model normalizer and OpenCode Zen catalog
by Clawborn · 2026-02-21
78.3%
#23040: Upgrade default Google model to Gemini 3.1 Pro and add Venice catal...
by Clawborn · 2026-02-21
78.1%
#22899: fix(models): synthesize antigravity Gemini 3.1 pro high/low models
by Phineas1500 · 2026-02-21
77.6%
#23337: fix: move @discordjs/opus to optionalDependencies [AI-assisted 🤖]
by davidmckenzie · 2026-02-22
77.3%
#22337: fix(models): add fallback Gemini 3.1 Pro Preview catalog entry
by AIflow-Labs · 2026-02-21
77.1%
#23139: test: fix flaky auth tests when OPENCLAW_GATEWAY_TOKEN is present
by Imccccc · 2026-02-22
76.5%
#21263: fix: add google-vertex support for Gemini 3.1 models
by pdd-cli · 2026-02-19
75.8%