fix(clawdbot): add browser executablePath and use configOverrides - #553
Conversation
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughReplaces the inline Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
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 |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue preventing the clawdbot browser tool from functioning correctly on Linux environments. It refactors the configuration approach to use "configOverrides" to ensure settings are properly applied and explicitly defines the Chromium executable path, thereby enabling headless browser operations for web search functionalities on Linux. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
- Use configOverrides instead of config (upstream nix-clawdbot bug: config isn't merged into output) - Add explicit executablePath for chromium to fix browser detection - Enables headless browser on Linux for web search capabilities
Mesa DescriptionTL;DRFixes Clawdbot's browser on Linux to correctly find Chromium and enable headless browsing, restoring web search capabilities, by updating its Nix configuration. What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request correctly addresses the issue of finding the Chromium executable on Linux by adding an explicit executablePath. The switch from config to configOverrides is well-justified by the comment regarding the upstream nix-clawdbot behavior. The refactoring to use lib.optionalAttrs for the conditional gateway configuration is a good, idiomatic Nix pattern that ensures a plain attribute set is generated, which seems to be what's required here. The changes look solid and effectively resolve the described problem.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
home-manager/modules/clawdbot/default.nix (1)
67-78: Well-documented configuration change with proper conditional merging.The switch from
configtoconfigOverridesis clearly documented with the NOTE comment explaining the upstream issue. The use oflib.optionalAttrs pkgs.stdenv.isLinuxfor the gateway configuration is idiomatic Nix for conditional attribute sets.One minor suggestion per coding guidelines: attribute sets should be sorted alphabetically. The
browserblock attributes could be reordered:♻️ Suggested alphabetical ordering
configOverrides = { browser = { enabled = true; + executablePath = "${pkgs.chromium}/bin/chromium"; headless = pkgs.stdenv.isLinux; - executablePath = "${pkgs.chromium}/bin/chromium"; }; } // lib.optionalAttrs pkgs.stdenv.isLinux {
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
home-manager/modules/clawdbot/default.nix
🧰 Additional context used
📓 Path-based instructions (6)
**/*.nix
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.nix: Use nixfmt for formatting all Nix files
Document complex configurations with comments in Nix files
**/*.nix: Use 2 spaces for indentation in Nix files
Keep line length under 100 characters in Nix files
Sort attribute sets alphabetically in Nix files
Use consistent spacing around operators in Nix files
Format lists and sets consistently in Nix filesUse treefmt.toml for formatting Nix files
**/*.nix: UsemkOptionfor configurable options in Nix modules
Implement proper typing for all options in Nix modules
Follow the Nix expression language style guide
Files:
home-manager/modules/clawdbot/default.nix
**/default.nix
📄 CodeRabbit inference engine (CLAUDE.md)
Use
default.nixfiles for module exports
Files:
home-manager/modules/clawdbot/default.nix
home-manager/modules/*/default.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
Custom modules must be located in
home-manager/modules/<name>/and must include adefault.nixfile
Files:
home-manager/modules/clawdbot/default.nix
home-manager/modules/**/default.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
Custom modules should include proper option types and document all options
Each module in
home-manager/modules/should have a cleardefault.nixwith proper option declarations following the home-manager module structure
Files:
home-manager/modules/clawdbot/default.nix
home-manager/**/*.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
home-manager/**/*.nix: Use typed options whenever possible in Nix configurations
Document all configuration options in Nix modules and programs
Follow home-manager's module structure and keep configurations modular
Use proper indentation and formatting in Nix configuration files
Files:
home-manager/modules/clawdbot/default.nix
home-manager/modules/**/*.nix
📄 CodeRabbit inference engine (.cursor/rules/nix.mdc)
Document all custom modules and options
Files:
home-manager/modules/clawdbot/default.nix
🧠 Learnings (4)
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Document all major changes in Nix configurations
Applied to files:
home-manager/modules/clawdbot/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/**/*.nix : Document all configuration options in Nix modules and programs
Applied to files:
home-manager/modules/clawdbot/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/programs/**/*.nix : Follow program-specific best practices in program configuration files
Applied to files:
home-manager/modules/clawdbot/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/**/*.nix : Follow home-manager's module structure and keep configurations modular
Applied to files:
home-manager/modules/clawdbot/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
- GitHub Check: Agent
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Mesa Review
- GitHub Check: lua-neovim-test
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: nix-linux
- GitHub Check: nix-darwin
- GitHub Check: nix-nixos
- GitHub Check: shell-lint
- GitHub Check: shell-test
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: lua-hammerspoon
- GitHub Check: lua-neovim
| browser = { | ||
| enabled = true; | ||
| headless = pkgs.stdenv.isLinux; | ||
| executablePath = "${pkgs.chromium}/bin/chromium"; | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's look at the full clawdbot module to understand the context
cat home-manager/modules/clawdbot/default.nixRepository: shunkakinoki/dotfiles
Length of output: 3752
🏁 Script executed:
# Check chromium references in the codebase
rg -n "chromium" --type nix -C 2Repository: shunkakinoki/dotfiles
Length of output: 756
🏁 Script executed:
# Check the flake.nix to see how packages are defined
head -100 flake.nixRepository: shunkakinoki/dotfiles
Length of output: 2646
🏁 Script executed:
# Check if there are Darwin-specific handling in the module
rg -n "isDarwin\|isLinux\|stdenv" home-manager/modules/clawdbot/default.nixRepository: shunkakinoki/dotfiles
Length of output: 47
🏁 Script executed:
# Check if chromium is available on macOS in nixpkgs and if there's a Darwin alternative
rg -n "chromium" home-manager/packages/default.nix -B 5 -A 5Repository: shunkakinoki/dotfiles
Length of output: 263
🏁 Script executed:
# Check if there's any Darwin-specific browser configuration elsewhere
rg -n "darwin\|isDarwin" home-manager/modules/clawdbot/default.nix -B 2 -A 2Repository: shunkakinoki/dotfiles
Length of output: 47
🏁 Script executed:
# Check the home-manager/packages/default.nix to understand full context
cat home-manager/packages/default.nixRepository: shunkakinoki/dotfiles
Length of output: 1432
Make browser configuration platform-conditional or provide Darwin alternative.
The code unconditionally enables the browser and references ${pkgs.chromium} on line 72, but chromium is only available in the Linux package set (lib.optionals (stdenv.isLinux && !isCI) in home-manager/packages/default.nix). Since clawdbot runs on both Darwin and Linux (via launchd.enable and systemd.enable conditionals), this configuration will fail on macOS builds.
Either guard the browser configuration with pkgs.stdenv.isLinux, provide a Darwin-specific browser path, or ensure chromium is available on all supported platforms.
There was a problem hiding this comment.
Pull request overview
This PR fixes browser tool detection on Linux by switching from config to configOverrides (to work around an upstream nix-clawdbot bug) and adding an explicit executablePath for chromium.
Changes:
- Replace
configwithconfigOverridesto work around upstream module bug whereconfigoption isn't merged into output JSON - Add explicit
executablePathpointing to chromium binary for browser detection - Refactor gateway configuration to use
lib.optionalAttrsinstead of nestedlib.mkIf
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| browser = { | ||
| enabled = true; | ||
| headless = pkgs.stdenv.isLinux; | ||
| executablePath = "${pkgs.chromium}/bin/chromium"; |
There was a problem hiding this comment.
The executablePath is unconditionally set to chromium for all platforms, but chromium is only installed on Linux (see home-manager/packages/default.nix line 108). On macOS, this will cause a build failure since pkgs.chromium won't be available. The executablePath should only be set for Linux systems, similar to how the headless property is conditionally set.
There was a problem hiding this comment.
Performed full review of 9ec365f...aff45ed
Analysis
-
The PR sets
executablePathunconditionally to Chromium's path without checking if Chromium is actually installed on the platform (particularly an issue for macOS where Chromium isn't installed) -
Inconsistent browser strategy between platforms: headless mode is only enabled for Linux, but the code always references Chromium which isn't available on macOS
-
The change relies on a workaround using
configOverridesinstead ofconfigdue to an upstream bug in nix-clawdbot, creating technical debt that should be tracked -
While functional now, the implementation makes Linux-centric assumptions that could cause issues if the CI guard is ever removed or the configuration needs to work in other contexts
Tip
Help
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
0 files reviewed | 1 comments | Edit Agent Settings • Read Docs
| browser = { | ||
| enabled = true; | ||
| headless = pkgs.stdenv.isLinux; | ||
| executablePath = "${pkgs.chromium}/bin/chromium"; |
There was a problem hiding this comment.
The executablePath is hardcoded to chromium regardless of platform. While this works currently because the module is disabled in CI and chromium is installed on Linux, it creates a subtle dependency assumption. Consider making this conditional:
executablePath = lib.optionalString pkgs.stdenv.isLinux "${pkgs.chromium}/bin/chromium";This would make the browser configuration more robust if the module's guards change in the future, and better documents that chromium is only available on Linux (per packages/default.nix lines 107-114).
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#553
File: home-manager/modules/clawdbot/default.nix#L72
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
The executablePath is hardcoded to chromium regardless of platform. While this works currently because the module is disabled in CI and chromium is installed on Linux, it creates a subtle dependency assumption. Consider making this conditional:
```nix
executablePath = lib.optionalString pkgs.stdenv.isLinux "${pkgs.chromium}/bin/chromium";
This would make the browser configuration more robust if the module's guards change in the future, and better documents that chromium is only available on Linux (per packages/default.nix lines 107-114).
</details>
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="home-manager/modules/clawdbot/default.nix">
<violation number="1" location="home-manager/modules/clawdbot/default.nix:72">
P1: Chromium is referenced unconditionally, breaking macOS builds where `pkgs.chromium` is unavailable</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| browser = { | ||
| enabled = true; | ||
| headless = pkgs.stdenv.isLinux; | ||
| executablePath = "${pkgs.chromium}/bin/chromium"; |
There was a problem hiding this comment.
P1: Chromium is referenced unconditionally, breaking macOS builds where pkgs.chromium is unavailable
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/modules/clawdbot/default.nix, line 72:
<comment>Chromium is referenced unconditionally, breaking macOS builds where `pkgs.chromium` is unavailable</comment>
<file context>
@@ -64,12 +64,15 @@ lib.mkIf (!env.isCI) {
browser = {
enabled = true;
headless = pkgs.stdenv.isLinux;
+ executablePath = "${pkgs.chromium}/bin/chromium";
};
- gateway = lib.mkIf pkgs.stdenv.isLinux {
</file context>
✅ Addressed in 9eef433
Chromium is not available on macOS, so the executablePath should only be set on Linux. This fixes the macOS e2e build failure. Also fixes nix formatting.
Summary
Fixes browser tool not finding chromium on Linux.
Changes
Testing
Built and verified config output includes:
```json
"browser": {
"enabled": true,
"executablePath": "/nix/store/.../chromium",
"headless": true
}
```
Summary by cubic
Fixes Clawdbot’s browser on Linux so Chromium is found and headless browsing works. Restores web search capability.
Written for commit 9eef433. Summary will update on new commits.