Skip to content

feat: update Clawdbot and Codex configurations - #633

Merged
shunkakinoki merged 8 commits into
mainfrom
update
Jan 21, 2026
Merged

feat: update Clawdbot and Codex configurations#633
shunkakinoki merged 8 commits into
mainfrom
update

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jan 21, 2026

Copy link
Copy Markdown
Owner

Changes

  • Updated Clawdbot.app installation to use 'ditto' for macOS bundle attributes
  • Updated Codex command to use 'exec' for function calls
  • Added homebrew environment loading to bash, fish, and zsh
  • Fixed model name formatting for glm-4-7-flash
  • Added test helpers and updated specs

Technical Details

  • Modified 18 files with improved bundle handling and environment setup
  • Enhanced testing infrastructure with custom matchers

Testing

  • All checks pass

Generated with opencode by claude-3-7-sonnet


Summary by cubic

Improved Clawdbot macOS app handling, switched Codex functions to use exec, and loaded Homebrew in shells to make tools work reliably. Added Go build support and more robust cargo global version parsing.

  • New Features

    • Install Clawdbot.app with ditto and launch via open to keep full bundle context.
    • Load Homebrew in bash, zsh, and fish; set OpenSSL vars on Linux for cargo builds.
    • Codex fish functions use codex exec; local profile commands updated.
    • update-local-binaries supports Go (go.mod) and cmd/{repo_name} builds.
  • Bug Fixes

    • Corrected glm-4-7-flash profile name in config and functions.
    • Cargo globals script handles table-style versions and maps installed versions for accurate skips.
    • Fixed repo path detection in update-local-binaries for expanded paths.

Written for commit 421d357. Summary will update on new commits.

Copilot AI review requested due to automatic review settings January 21, 2026 00:39
@shunkakinoki
shunkakinoki enabled auto-merge (squash) January 21, 2026 00:39
@mesa-dot-dev

mesa-dot-dev Bot commented Jan 21, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 significantly refines the system's configuration and tooling, focusing on improved application deployment, shell environment management, and build process automation. It addresses issues with macOS application bundle integrity, standardizes command execution for the Codex tool, and expands the build system's capabilities to include Go projects. These changes aim to enhance the reliability and consistency of the development environment.

Highlights

  • Clawdbot.app Installation & Launch: Improved the installation of Clawdbot.app on macOS by switching from cp -R to ditto to preserve all macOS bundle attributes, and updated its launchd agent to use open -a for proper application context.
  • Codex Command Execution: Modified Codex-related shell functions (_coxe_function, _coxeh_function, _coxel_function, _coxelh_function) to explicitly use codex exec for function calls, ensuring correct command invocation.
  • Shell Environment Configuration: Enhanced bash, fish, and zsh configurations to correctly load Homebrew environment variables and added OpenSSL environment variables for Linux cargo builds.
  • Codex Model Name Formatting: Corrected the model name format for glm-4-7-flash in config.toml and updated corresponding descriptions and calls in fish functions.
  • Cargo Globals Script Improvements: Refined the install-cargo-globals.sh script to better parse table-style dependency versions from Cargo.toml and implemented an efficient method to check for already installed cargo packages using an associative array.
  • Go Project Build Support: Extended the update-local-binaries.sh script to detect and build Go projects, including support for the go.mod file and the cmd/{repo_name} build pattern.
  • Testing Infrastructure Updates: Introduced new test helpers and updated existing specifications (cargo_globals_spec.sh, update_local_binaries_spec.sh) to cover the new dependency parsing, installed version checking, and Go project build logic.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Jan 21, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Updated Clawdbot and Codex configurations, including improved macOS bundle handling, exec for Codex function calls, and consistent Homebrew environment loading across shells. Also, added Go build support and refined Cargo global version parsing.

What changed?

  • .local-binaries.txt: Added ~/ghq/github.com/dlorenc/multiclaude/multiclaude to local binaries.
  • config/codex/config.toml: Renamed glm-4.7-flash profile to glm-4-7-flash (dot to hyphen).
  • home-manager/modules/cargo-globals/install-cargo-globals.sh: Refactored script for better Cargo.toml dependency parsing, using an associative array for installed packages.
  • home-manager/modules/clawdbot/default.nix: Updated Clawdbot.app auto-start on macOS to use open -a for proper bundle context.
  • home-manager/programs/bash/default.nix: Set OpenSSL environment variables for cargo builds on Linux and ensured ~/.bashrc sourcing for login shells.
  • home-manager/programs/fish/default.nix: Added conditional logic to Fish shell initialization for Homebrew environment evaluation on macOS.
  • home-manager/programs/fish/functions/_coxe_function.fish: Modified _coxe_function to include exec after the codex command.
  • home-manager/programs/fish/functions/_coxeh_function.fish: Updated _coxeh_function to use codex exec instead of codex directly.
  • home-manager/programs/fish/functions/_coxel_function.fish: Corrected model name from glm-4.7-flash to glm-4-7-flash and explicitly used codex exec.
  • home-manager/programs/fish/functions/_coxelh_function.fish: Corrected model name typo from glm-4.7-flash to glm-4-7-flash and changed codex command to codex exec.
  • home-manager/programs/zsh/default.nix: Refactored Zsh configuration to use envExtra for environment variables, including Homebrew loading for macOS and OpenSSL variables for Linux cargo builds.
  • nix-darwin/default.nix: Updated Clawdbot.app installation on 'galactica' hosts from cp -R to ditto to preserve macOS bundle attributes.
  • overlays/default.nix: Changed installPhase for Clawdbot macOS app bundle to use cp -p for preserving file attributes.
  • scripts/update-local-binaries.sh: Enhanced script to support Go projects by detecting go.mod files and attempting to build either the ./cmd/{repo_name} subdirectory or the module root.
  • spec/cargo_globals_spec.sh: Added new test cases for table-style dependency versions and correct building of installed version map.
  • spec/spec_helper.sh: Updated spec_helper_configure function to change an import path.
  • spec/update_local_binaries_spec.sh: Introduced comprehensive support for Go projects with new test cases for go.mod detection and go build execution.

Description generated by Mesa. Update settings

@coderabbitai

coderabbitai Bot commented Jan 21, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Go module support for building local binaries
    • Enhanced Homebrew shell environment initialization in Fish and Zsh
  • Bug Fixes

    • Fixed Clawdbot.app launch to properly preserve macOS bundle attributes
    • Improved binary installation process with better metadata preservation
    • Enhanced package dependency parsing and installation tracking
  • Tests

    • Expanded test coverage for package installation and build system handling

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

This PR introduces multiple coordinated enhancements: updates Codex profile naming conventions (glm-4.7-flash → glm-4-7-flash) with corresponding function invocation changes, adds Go module support to the local binaries build script, enhances cargo globals installation with version caching via INSTALLED_MAP, improves macOS application bundle preservation for Clawdbot, and adds conditional Homebrew initialization for Fish and Zsh shells.

Changes

Cohort / File(s) Summary
Codex Configuration & Functions
config/codex/config.toml, home-manager/programs/fish/functions/_coxe_function.fish, home-manager/programs/fish/functions/_coxeh_function.fish, home-manager/programs/fish/functions/_coxel_function.fish, home-manager/programs/fish/functions/_coxelh_function.fish
Renamed profile header from [profiles.glm-4.7-flash] to [profiles.glm-4-7-flash] and updated all Codex Fish function invocations from codex to codex exec with matching profile references. Updated function descriptions to reflect new naming.
Build System Enhancements
scripts/update-local-binaries.sh, spec/update_local_binaries_spec.sh
Added Go module (.go.mod) detection and build support, including support for cmd/<repo_name> pattern. Improved repo directory extraction logic. Expanded test coverage with Go-specific test cases.
Cargo Globals Installation
home-manager/modules/cargo-globals/install-cargo-globals.sh, spec/cargo_globals_spec.sh
Introduced INSTALLED_MAP associative array for caching installed crate versions, enhanced dependency version parsing to support both table-style ({name, version}) and string formats, improved installation decision logic with version matching. Added corresponding test coverage.
Application Launch & Bundle Handling
home-manager/modules/clawdbot/default.nix, nix-darwin/default.nix, overlays/default.nix
Modified Clawdbot launchd agent to launch via open -a "/Applications/Clawdbot.app" instead of direct binary execution; replaced cp -R with ditto (nix-darwin) or cp -pR (overlays) to preserve macOS bundle attributes and extended attributes.
Shell Environment Initialization
home-manager/programs/fish/default.nix, home-manager/programs/zsh/default.nix
Added conditional Homebrew environment initialization in both Fish (loginShellInit and interactiveShellInit) and Zsh (envExtra) when /opt/homebrew/bin/brew exists.
Binary Path Management
.local-binaries.txt
Added new local binary path entry for ~/ghq/github.com/dlorenc/multiclaude/multiclaude.
Test Infrastructure
spec/spec_helper.sh
Switched test helper import from support/custom_matcher to test_helpers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #629: Modifies local binaries system including .local-binaries.txt and scripts/update-local-binaries.sh with similar changes.
  • #305: Modifies Codex Fish functions and configuration profile naming with overlapping naming convention updates.
  • #619: Modifies install-cargo-globals.sh with INSTALLED_MAP caching mechanism for dependency tracking.

Suggested labels

enhancement

Poem

A binary finds home, profiles get new names,
Go modules join Rust in the build-time games,
Clawdbot flies through bundles with care,
Homebrew settles where shells declare—
The rabbit hops faster with each careful change! 🐰✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several updates and fixes across configurations and scripts. Key changes include updating Clawdbot installation to use ditto for better macOS app handling, switching Codex functions to use the exec subcommand, and adding Homebrew environment loading for bash, fish, and zsh shells. The cargo global installation script is improved to handle more version formats and to more efficiently check for installed packages. Additionally, the local binary update script now supports building Go projects.

My review focuses on improving maintainability and performance by reducing code duplication in shell configurations and optimizing script logic. I've suggested refactoring in a few shell scripts to make them more efficient and easier to read.

Comment on lines 56 to 57
CRATE=$(echo "$pkg" | cut -d'@' -f1)
VERSION=$(echo "$pkg" | cut -d'@' -f2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better performance and to follow shell scripting best practices, consider using shell parameter expansion to extract the crate name and version instead of forking cut twice in a loop. This avoids creating subshells for each dependency.

Suggested change
CRATE=$(echo "$pkg" | cut -d'@' -f1)
VERSION=$(echo "$pkg" | cut -d'@' -f2)
CRATE=${pkg%@*}
VERSION=${pkg#*@}

Comment on lines +72 to +79
# OpenSSL for cargo builds on Linux (available in login shells)
if [ "$(uname)" = "Linux" ]; then
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export OPENSSL_DIR="${pkgs.openssl.dev}"
export OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib"
export OPENSSL_INCLUDE_DIR="${pkgs.openssl.dev}/include"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This block of code, which sets up OpenSSL environment variables for Linux, is a duplicate of the logic already present in bashrcExtra (lines 39-44). Since profileExtra now sources ~/.bashrc (lines 82-84), these settings will be applied for login shells anyway. To avoid redundancy and improve maintainability, this duplicated block can be removed.

Comment on lines +49 to +51
if test -f /opt/homebrew/bin/brew
eval "$(/opt/homebrew/bin/brew shellenv)"
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Homebrew environment setup is duplicated in both loginShellInit and interactiveShellInit. Since a login shell is typically also interactive, this can lead to eval "$(/opt/homebrew/bin/brew shellenv)" being executed twice, which is unnecessary and can slightly slow down shell startup.

To avoid this duplication, you could move this block to shellInit (around line 25), which is sourced only once for all shell sessions. This would ensure the Homebrew environment is set up correctly and efficiently for all shell types.

Comment on lines +113 to +124
if [ -d "$repo_dir/cmd/$repo_name" ]; then
if (cd "$repo_dir" && go build "./cmd/$repo_name" 2>&1); then
return 0
else
return 1
fi
else
if (cd "$repo_dir" && go build 2>&1); then
return 0
else
return 1
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for building a Go project can be refactored to be more concise and less repetitive. You can determine the build path first and then have a single go build command.

Suggested change
if [ -d "$repo_dir/cmd/$repo_name" ]; then
if (cd "$repo_dir" && go build "./cmd/$repo_name" 2>&1); then
return 0
else
return 1
fi
else
if (cd "$repo_dir" && go build 2>&1); then
return 0
else
return 1
fi
local build_path="."
if [ -d "$repo_dir/cmd/$repo_name" ]; then
build_path="./cmd/$repo_name"
fi
if (cd "$repo_dir" && go build "$build_path" 2>&1); then
return 0
else
return 1
fi

@shunkakinoki
shunkakinoki disabled auto-merge January 21, 2026 00:41
@shunkakinoki
shunkakinoki merged commit 4f7c78b into main Jan 21, 2026
20 of 21 checks passed
@shunkakinoki
shunkakinoki deleted the update branch January 21, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates several configurations related to Clawdbot installation, Codex command usage, and shell environment setup. The changes focus on improving macOS bundle handling, adding Go build support, and standardizing Homebrew environment loading across shells.

Changes:

  • Improved macOS bundle handling for Clawdbot.app with ditto/cp -pR to preserve bundle attributes
  • Updated Codex commands to use 'exec' subcommand and fixed glm-4-7-flash model naming
  • Added Homebrew environment loading to bash, fish, and zsh shells
  • Enhanced cargo-globals script with table-style dependency version support
  • Added Go build support to local binaries update script

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
spec/test_helpers.sh New test helper functions for mock binaries and Nix script preprocessing
spec/spec_helper.sh Updated to import new test_helpers instead of custom_matcher
spec/update_local_binaries_spec.sh Added tests for Go build support with go.mod detection
spec/cargo_globals_spec.sh Added tests for table-style dependency versions and installed version map
scripts/update-local-binaries.sh Added Go build support with cmd/{repo_name} pattern detection
overlays/default.nix Changed cp -R to cp -pR for Clawdbot.app installation
nix-darwin/default.nix Changed from cp -R to ditto for proper macOS bundle attribute preservation
home-manager/modules/clawdbot/default.nix Updated launchd to use 'open' command instead of direct binary execution
config/codex/config.toml Renamed profile from glm-4.7-flash to glm-4-7-flash
home-manager/programs/fish/functions/_coxel_function.fish Updated to use 'codex exec' and corrected model name
home-manager/programs/fish/functions/_coxelh_function.fish Updated to use 'codex exec' and corrected model name
home-manager/programs/fish/functions/_coxe_function.fish Updated to use 'codex exec'
home-manager/programs/fish/functions/_coxeh_function.fish Updated to use 'codex exec'
home-manager/programs/fish/default.nix Added Homebrew environment loading in loginShellInit and interactiveShellInit
home-manager/programs/bash/default.nix Added Homebrew loading and OpenSSL configuration in profileExtra
home-manager/programs/zsh/default.nix Added Homebrew loading in envExtra
home-manager/modules/cargo-globals/install-cargo-globals.sh Enhanced to support table-style dependency versions and use associative array for installed packages
.local-binaries.txt Added multiclaude binary entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread overlays/default.nix
exit 1
fi
cp -R "$app_path" "$out/Applications/Clawdbot.app"
cp -pR "$app_path" "$out/Applications/Clawdbot.app"

Copilot AI Jan 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While cp -pR preserves permissions and timestamps, it doesn't preserve macOS extended attributes and resource forks which are critical for Bundle.module lookups. Consider using ditto here as well (similar to the fix in nix-darwin/default.nix) or using rsync -a --xattrs to ensure all macOS bundle attributes are preserved.

Suggested change
cp -pR "$app_path" "$out/Applications/Clawdbot.app"
ditto "$app_path" "$out/Applications/Clawdbot.app"

Copilot uses AI. Check for mistakes.
elif [ -f "$repo_dir/go.mod" ]; then
# Go project: build ./cmd/{repo_name} if it exists, otherwise build root
if [ -d "$repo_dir/cmd/$repo_name" ]; then
if (cd "$repo_dir" && go build "./cmd/$repo_name" 2>&1); then

Copilot AI Jan 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The go build command for cmd/{repo_name} pattern doesn't specify an output location, which means the binary will be placed in the cmd/{repo_name} directory rather than at the repository root where other build systems typically place their outputs. Consider using 'go build -o {repo_name} ./cmd/{repo_name}' to place the output binary at the repository root for consistency with Rust and Make builds.

Suggested change
if (cd "$repo_dir" && go build "./cmd/$repo_name" 2>&1); then
if (cd "$repo_dir" && go build -o "$repo_name" "./cmd/$repo_name" 2>&1); then

Copilot uses AI. Check for mistakes.
Label = "com.clawdbot.app";
ProgramArguments = [
"/Applications/Clawdbot.app/Contents/MacOS/Clawdbot"
"open"

Copilot AI Jan 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'open' as a direct command in ProgramArguments may not work as expected in launchd. The 'open' command typically requires a full path. Consider using '/usr/bin/open' instead of just 'open' to ensure launchd can find and execute the command reliably.

Suggested change
"open"
"/usr/bin/open"

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +52
if test -f /opt/homebrew/bin/brew
eval "$(/opt/homebrew/bin/brew shellenv)"
end

Copilot AI Jan 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Homebrew environment loading is duplicated in both loginShellInit and interactiveShellInit. This could lead to unnecessary overhead and potential issues. The brew shellenv should typically only be loaded once, preferably in loginShellInit.

Suggested change
if test -f /opt/homebrew/bin/brew
eval "$(/opt/homebrew/bin/brew shellenv)"
end

Copilot uses AI. Check for mistakes.
Comment thread config/codex/config.toml

[profiles.glm-4.7-flash]
[profiles.glm-4-7-flash]
model = "zai-org/glm-4.7-flash"

Copilot AI Jan 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The profile name was changed to 'glm-4-7-flash' (with hyphens), but the model name itself is still 'zai-org/glm-4.7-flash' (with a dot). This inconsistency could cause confusion. Consider updating the model name to use hyphens consistently, i.e., 'zai-org/glm-4-7-flash'.

Suggested change
model = "zai-org/glm-4.7-flash"
model = "zai-org/glm-4-7-flash"

Copilot uses AI. Check for mistakes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 18 files

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants