-
Notifications
You must be signed in to change notification settings - Fork 0
feat: update Clawdbot and Codex configurations #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c5118d0
c82a021
0937a34
eaa6400
9c1f013
45019e4
d3cd5a4
421d357
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,7 @@ if ! command -v jq &>/dev/null; then | |||||||||
| fi | ||||||||||
|
|
||||||||||
| # Parse dependencies from standard Cargo.toml format | ||||||||||
| DEPS=$(dasel -f "$CARGO_TOML" -r toml -w json 'dependencies' 2>/dev/null | jq -r 'to_entries[] | "\(.key)@\(.value)"' 2>/dev/null || true) | ||||||||||
| DEPS=$(dasel -f "$CARGO_TOML" -r toml -w json 'dependencies' 2>/dev/null | jq -r 'to_entries[] | "\(.key)@\(.value.version // .value)"' 2>/dev/null || true) | ||||||||||
|
|
||||||||||
| if [ -z "$DEPS" ]; then | ||||||||||
| echo "No dependencies found in Cargo.toml" | ||||||||||
|
|
@@ -39,13 +39,25 @@ fi | |||||||||
|
|
||||||||||
| # Get currently installed packages (cargo's native cache) | ||||||||||
| INSTALLED=$(cargo install --list 2>/dev/null || true) | ||||||||||
| declare -A INSTALLED_MAP=() | ||||||||||
|
|
||||||||||
| echo "$DEPS" | while read -r pkg; do | ||||||||||
| while read -r line; do | ||||||||||
| case "$line" in | ||||||||||
| "" | " "*) continue ;; | ||||||||||
| *) | ||||||||||
| if [[ $line =~ ^([^[:space:]]+)[[:space:]]v([^:]+): ]]; then | ||||||||||
| INSTALLED_MAP["${BASH_REMATCH[1]}"]="${BASH_REMATCH[2]}" | ||||||||||
| fi | ||||||||||
| ;; | ||||||||||
| esac | ||||||||||
| done <<<"$INSTALLED" | ||||||||||
|
|
||||||||||
| while read -r pkg; do | ||||||||||
| CRATE=$(echo "$pkg" | cut -d'@' -f1) | ||||||||||
| VERSION=$(echo "$pkg" | cut -d'@' -f2) | ||||||||||
|
Comment on lines
56
to
57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
|
||||||||||
| if [ -n "$CRATE" ]; then | ||||||||||
| # Check if already installed at this version (format: "crate_name v1.2.3:") | ||||||||||
| if echo "$INSTALLED" | grep -q "^${CRATE} v${VERSION}:"; then | ||||||||||
| if [ "${INSTALLED_MAP[$CRATE]:-}" = "$VERSION" ]; then | ||||||||||
| echo "$CRATE@$VERSION already installed, skipping" | ||||||||||
| continue | ||||||||||
| fi | ||||||||||
|
|
@@ -54,6 +66,6 @@ echo "$DEPS" | while read -r pkg; do | |||||||||
| cargo install "$CRATE" --version "$VERSION" 2>/dev/null || | ||||||||||
| echo "Failed to install $CRATE@$VERSION, skipping..." | ||||||||||
| fi | ||||||||||
| done | ||||||||||
| done <<<"$DEPS" | ||||||||||
|
|
||||||||||
| echo "cargo globals check complete" | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -97,13 +97,18 @@ lib.mkIf (!env.isCI) { | |||||
| ); | ||||||
|
|
||||||
| # Auto-start Clawdbot.app on login (galactica only) | ||||||
| # App is installed to /Applications/Nix Apps/ via nix-darwin | ||||||
| # Use /usr/bin/open to launch the app properly with full bundle context, | ||||||
| # rather than running the binary directly which breaks Bundle.module lookups | ||||||
| launchd.agents.clawdbot-app = lib.mkIf (pkgs.stdenv.isDarwin && host.isGalactica) { | ||||||
| enable = true; | ||||||
| config = { | ||||||
| Label = "com.clawdbot.app"; | ||||||
| ProgramArguments = [ | ||||||
| "/Applications/Clawdbot.app/Contents/MacOS/Clawdbot" | ||||||
| "open" | ||||||
|
||||||
| "open" | |
| "/usr/bin/open" |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,10 @@ | |||||||
| direnv hook fish | source | ||||||||
| ''; | ||||||||
| loginShellInit = '' | ||||||||
| if test -f /opt/homebrew/bin/brew | ||||||||
| eval "$(/opt/homebrew/bin/brew shellenv)" | ||||||||
| end | ||||||||
|
|
||||||||
| fish_add_path -p ~/.local/bin | ||||||||
| fish_add_path -p ~/.bun/bin | ||||||||
| fish_add_path -p ~/.cargo/bin | ||||||||
|
|
@@ -41,6 +45,11 @@ | |||||||
| _hm_load_env_file | ||||||||
| set fish_greeting | ||||||||
| set fish_theme dracula | ||||||||
|
|
||||||||
| if test -f /opt/homebrew/bin/brew | ||||||||
| eval "$(/opt/homebrew/bin/brew shellenv)" | ||||||||
| end | ||||||||
|
Comment on lines
+49
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Homebrew environment setup is duplicated in both To avoid this duplication, you could move this block to |
||||||||
|
|
||||||||
|
Comment on lines
+49
to
+52
|
||||||||
| if test -f /opt/homebrew/bin/brew | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| function _coxel_function --description "Run Codex with a free-form prompt using the local glm-4.7-flash model" | ||
| # Run Codex with a free-form prompt (spaces allowed) using the local glm-4.7-flash model | ||
| function _coxel_function --description "Run Codex with a free-form prompt using the local glm-4-7-flash model" | ||
| # Run Codex with a free-form prompt (spaces allowed) using the local glm-4-7-flash model | ||
| # Usage: cxel [<prompt words...>] | ||
|
|
||
| if test (count $argv) -eq 0 | ||
| codex --profile 'glm-4.7-flash' --full-auto -c model_reasoning_summary_format=experimental | ||
| codex --profile 'glm-4-7-flash' --full-auto -c model_reasoning_summary_format=experimental | ||
| else | ||
| set -l prompt (string join " " -- $argv) | ||
| codex --profile 'glm-4.7-flash' --full-auto -c model_reasoning_summary_format=experimental -- "$prompt" | ||
| codex exec --profile 'glm-4-7-flash' --full-auto -c model_reasoning_summary_format=experimental -- "$prompt" | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,7 +52,7 @@ in | |||||
| echo "Clawdbot.app not found in $src" >&2 | ||||||
| exit 1 | ||||||
| fi | ||||||
| cp -R "$app_path" "$out/Applications/Clawdbot.app" | ||||||
| cp -pR "$app_path" "$out/Applications/Clawdbot.app" | ||||||
|
||||||
| cp -pR "$app_path" "$out/Applications/Clawdbot.app" | |
| ditto "$app_path" "$out/Applications/Clawdbot.app" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -78,7 +78,8 @@ get_repo_dir() { | |||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| # Fallback: assume 4 levels deep from ghq root (github.com/owner/repo) | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "$binary_path" | sed -E 's|(~/ghq/[^/]+/[^/]+/[^/]+)/.*|\1|' | sed "s|~|$HOME|" | ||||||||||||||||||||||||||||||||||||||||||||||
| # Note: binary_path is already expanded, so match against the full path | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "$binary_path" | sed -E 's|(.*/ghq/[^/]+/[^/]+/[^/]+)/.*|\1|' | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| # Get repo name for display | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -107,8 +108,23 @@ build_repo() { | |||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| return 1 | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,5 @@ spec_helper_precheck() { | |
| } | ||
|
|
||
| spec_helper_configure() { | ||
| import 'support/custom_matcher' | ||
| import 'test_helpers' | ||
| } | ||
There was a problem hiding this comment.
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'.