-
Notifications
You must be signed in to change notification settings - Fork 0
chore: update dotagents and fix Codex configuration #712
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
cc0cd00
f512a42
d2e2a5e
3f39994
bc69aff
23d10a5
8a8c4ed
52deedd
db0c880
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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ notify = [ | |
| "notify", | ||
| ] | ||
|
|
||
| suppress_unstable_features_warning = true | ||
| web_search = "cached" | ||
|
|
||
| [features] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,9 @@ | ||||||||||
| { config, ... }: | ||||||||||
| { config, lib, ... }: | ||||||||||
| { | ||||||||||
| home.file.".codex/config.toml" = { | ||||||||||
| source = ./config.toml; | ||||||||||
| force = true; | ||||||||||
| }; | ||||||||||
| # Use activation script instead of home.file symlink | ||||||||||
| # Codex CLI uses atomic writes that break symlinks, so we force-copy on each switch | ||||||||||
| home.activation.codexConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' | ||||||||||
| $DRY_RUN_CMD cp -f ${./config.toml} ~/.codex/config.toml | ||||||||||
| $DRY_RUN_CMD chmod 600 ~/.codex/config.toml | ||||||||||
|
Comment on lines
+6
to
+7
|
||||||||||
| $DRY_RUN_CMD cp -f ${./config.toml} ~/.codex/config.toml | |
| $DRY_RUN_CMD chmod 600 ~/.codex/config.toml | |
| $DRY_RUN_CMD cp -f ${./config.toml} ${config.home.homeDirectory}/.codex/config.toml | |
| $DRY_RUN_CMD chmod 600 ${config.home.homeDirectory}/.codex/config.toml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| ./k3s | ||
| ./karabiner | ||
| ./llm | ||
| ./openclaw | ||
|
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. P2: The new module import Prompt for AI agents |
||
| ./opencode | ||
| ./pi | ||
| ./serena | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||
| { | ||||||||||
| config, | ||||||||||
| lib, | ||||||||||
| pkgs, | ||||||||||
| inputs, | ||||||||||
| ... | ||||||||||
| }: | ||||||||||
| let | ||||||||||
| inherit (inputs) host; | ||||||||||
| homeDir = config.home.homeDirectory; | ||||||||||
|
|
||||||||||
| mode = if host.isKyber then "gateway" else "client"; | ||||||||||
|
|
||||||||||
| hydrateScript = pkgs.replaceVars ./hydrate.sh ({ | ||||||||||
| sed = "${pkgs.gnused}/bin/sed"; | ||||||||||
| template = ./openclaw.template.json; | ||||||||||
| inherit mode; | ||||||||||
| } // (if host.isKyber then { | ||||||||||
| chromium = pkgs.chromium; | ||||||||||
| openclaw = "${homeDir}/.bun"; | ||||||||||
| } else { | ||||||||||
| chromium = "/unused"; | ||||||||||
| openclaw = "/unused"; | ||||||||||
|
Comment on lines
+22
to
+23
|
||||||||||
| chromium = "/unused"; | |
| openclaw = "/unused"; | |
| chromium = ""; | |
| openclaw = ""; |
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 || true at the end of the bash command can mask potential failures during the OpenClaw configuration hydration. If the hydrateScript fails for any reason, the NixOS activation will still report success, potentially leading to a silently misconfigured OpenClaw. It's generally better to let the activation fail if a critical setup script fails, so the user is immediately aware of the problem.
${pkgs.bash}/bin/bash ${hydrateScript}
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 || true here will silently swallow all errors from the hydration script, including legitimate failures like permission errors or invalid config generation. Combined with line 36 in hydrate.sh that does exit 0 on missing GATEWAY_TOKEN, this creates a double-silent failure mode.
Consider removing the || true and handling specific expected failure cases in the script with appropriate exit codes, or at minimum log failures to a persistent location.
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#712
File: config/openclaw/default.nix#L31
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
The `|| true` here will silently swallow all errors from the hydration script, including legitimate failures like permission errors or invalid config generation. Combined with line 36 in hydrate.sh that does `exit 0` on missing GATEWAY_TOKEN, this creates a double-silent failure mode.
Consider removing the `|| true` and handling specific expected failure cases in the script with appropriate exit codes, or at minimum log failures to a persistent location.
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.
P2: The || true suffix will silently swallow all errors from the hydration script, including legitimate failures like permission errors or invalid config generation. Consider removing || true and handling specific expected failure cases in the script with appropriate exit codes, or at minimum log failures to a persistent location for debugging.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At config/openclaw/default.nix, line 31:
<comment>The `|| true` suffix will silently swallow all errors from the hydration script, including legitimate failures like permission errors or invalid config generation. Consider removing `|| true` and handling specific expected failure cases in the script with appropriate exit codes, or at minimum log failures to a persistent location for debugging.</comment>
<file context>
@@ -0,0 +1,33 @@
+ # Gateway mode on Kyber, client mode everywhere else
+ home.activation.hydrateOpenclawConfig = config.lib.dag.entryAfter [ "writeBoundary" ] ''
+ mkdir -p ${homeDir}/.openclaw
+ ${pkgs.bash}/bin/bash ${hydrateScript} || true
+ '';
+}
</file context>
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,13 +1,14 @@ | ||||||||||||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||||||||||||
| # OpenClaw gateway start script with runtime secret injection | ||||||||||||||||||||||||
| # OpenClaw config hydration with runtime secret injection | ||||||||||||||||||||||||
| # Mode is set by nix: "gateway" for Kyber, "client" for macOS | ||||||||||||||||||||||||
| # shellcheck source=/dev/null | ||||||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| MODE="@mode@" | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| MODE="@mode@" | |
| MODE="@mode@" | |
| case "$MODE" in | |
| gateway|client) | |
| ;; | |
| *) | |
| echo "Error: invalid MODE '$MODE'. Expected 'gateway' or 'client'." >&2 | |
| exit 1 | |
| ;; | |
| esac |
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 early exit with exit 0 when GATEWAY_TOKEN is missing will silently skip OpenClaw configuration without any persistent indication of failure. In client mode (macOS), this means users might not realize their OpenClaw isn't configured. Consider either:
- Creating a placeholder config file with an error marker that OpenClaw can detect
- Using a non-zero exit code and handling it gracefully in the activation script with
|| true - Logging to a file in ~/.openclaw/ that persists beyond stderr
The current approach could lead to confusing "OpenClaw not working" issues that are hard to debug.
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#712
File: config/openclaw/hydrate.sh#L36
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
The early exit with `exit 0` when GATEWAY_TOKEN is missing will silently skip OpenClaw configuration without any persistent indication of failure. In client mode (macOS), this means users might not realize their OpenClaw isn't configured. Consider either:
1. Creating a placeholder config file with an error marker that OpenClaw can detect
2. Using a non-zero exit code and handling it gracefully in the activation script with `|| true`
3. Logging to a file in ~/.openclaw/ that persists beyond stderr
The current approach could lead to confusing "OpenClaw not working" issues that are hard to debug.
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.
P2: Exiting with exit 0 (success) when GATEWAY_TOKEN is not set means the OpenClaw configuration hydration will silently fail. This can lead to unexpected behavior or non-functional components without clear indication during the activation process. Consider using a non-zero exit code to signal failure, or log to a persistent location in ~/.openclaw/ for debugging.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At config/openclaw/hydrate.sh, line 38:
<comment>Exiting with `exit 0` (success) when GATEWAY_TOKEN is not set means the OpenClaw configuration hydration will silently fail. This can lead to unexpected behavior or non-functional components without clear indication during the activation process. Consider using a non-zero exit code to signal failure, or log to a persistent location in `~/.openclaw/` for debugging.</comment>
<file context>
@@ -29,33 +30,53 @@ read_secret() {
-CHROMIUM_PATH="@chromium@/bin/chromium"
+if [ -z "${GATEWAY_TOKEN}" ]; then
+ echo "Warning: OPENCLAW_GATEWAY_TOKEN not set, skipping OpenClaw hydration" >&2
+ exit 0
+fi
</file context>
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.
Exiting with 0 (success) when the GATEWAY_TOKEN is not set means that the OpenClaw configuration hydration will silently fail if this critical token is missing. This can lead to unexpected behavior or non-functional components without clear indication during the NixOS activation process. It's best to exit with a non-zero status to signal a failure.
| exit 0 | |
| fi | |
| echo "Warning: OPENCLAW_GATEWAY_TOKEN not set, skipping OpenClaw hydration" >&2 | |
| exit 1 |
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.
In gateway mode, this exec replaces the shell process with the openclaw gateway command. However, this script is called during home-manager activation (line 31 of config/openclaw/default.nix), not as a persistent service starter. This means the gateway will start during activation and then be orphaned or terminated when activation completes.
Should this be a systemd service instead? Or should the exec be removed so this script only hydrates the config without starting the service?
Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#712
File: config/openclaw/hydrate.sh#L64
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.
Feedback:
In gateway mode, this `exec` replaces the shell process with the openclaw gateway command. However, this script is called during home-manager activation (line 31 of config/openclaw/default.nix), not as a persistent service starter. This means the gateway will start during activation and then be orphaned or terminated when activation completes.
Should this be a systemd service instead? Or should the exec be removed so this script only hydrates the config without starting the service?
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.
P1: Using exec to start the gateway during home-manager activation is problematic. This replaces the shell process with the openclaw gateway command, but since this runs during activation (not as a persistent service), the gateway will either be orphaned or terminated when activation completes. Consider either making this a systemd service, or removing the exec so the script only hydrates the config without attempting to start the gateway.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At config/openclaw/hydrate.sh, line 64:
<comment>Using `exec` to start the gateway during home-manager activation is problematic. This replaces the shell process with the openclaw gateway command, but since this runs during activation (not as a persistent service), the gateway will either be orphaned or terminated when activation completes. Consider either making this a systemd service, or removing the exec so the script only hydrates the config without attempting to start the gateway.</comment>
<file context>
@@ -29,33 +30,53 @@ read_secret() {
+ export ANTHROPIC_API_KEY
+ fi
+
+ exec @openclaw@/bin/openclaw gateway --port 18789 "$@"
-# Start OpenClaw gateway
</file context>
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| "/Applications/Ghostty.app" | ||
| "/Applications/Linear.app" | ||
| "/Applications/Tailscale.app" | ||
| "/Applications/Codex.app" | ||
|
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 pull request description states "Remove duplicate Codex app entry in persistent dock applications". However, this change adds
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. P2: This change adds Prompt for AI agents |
||
| "/Applications/Cursor.app" | ||
| "/Applications/Visual Studio Code.app" | ||
| "/Applications/Visual Studio Code - Insiders.app" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
P2: Activation script copies to ~/.codex/config.toml without ensuring ~/.codex exists, so on a clean install the activation will fail after removing home.file which previously created the directory.
Prompt for AI agents