Repository navigation
feat(home): install OpenClaw gateway via nix-openclaw - #1025
Conversation
Home Manager module (home/openclaw) running the OpenClaw gateway as an on-boot user service on the laptop: tailnet-bound on :18789, token auth from a local secret file, fleet provider proxies for models (DeepSeek v4 Flash default via CommandCode; Codex/OpenAI held as final reserve), runtime + bundled tool plugins, ACP (acpx) with OpenCode (the OpenChamber engine) as default coding harness, MCP servers mirroring mcpx, and a workspace context pack (fleet roles, repos, quota discipline, git/merge rules). Notes: summarize bundled plugin disabled for now (its ~780-package pnpm deps fetch kept dying on the flaky npmjs route; re-enable later). peekaboo/poltergeist are macOS-only in the nix-openclaw catalog. Predeclared agents.entries ACP runtimes are rejected by the pinned nix-openclaw schema; ACP agents spawn on demand via the top-level acp config.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2491cae5b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| baseUrl = "http://127.0.0.1:${toString port}/v1"; | ||
| # The laptop proxies are loopback-only and do not check an API key; | ||
| # this is a placeholder label, not a credential. | ||
| apiKey = "local-proxy"; |
There was a problem hiding this comment.
Use a placeholder key recognized by the Design proxy
When the primary provider fails and OpenClaw selects the Design fallback, Bearer local-proxy is treated as a real upstream credential: bin/design-code-proxy.mjs:63-74 only recognizes placeholders such as local and design-local. The proxy consequently forwards the request to AMR Link with this invalid key and passes authentication errors back instead of using its local dispatch (bin/design-code-proxy.mjs:137-172), making the first configured fallback unusable. Use an accepted placeholder, or configure the key separately for each provider.
Useful? React with 👍 / 👎.
| agyProxyPort = 18743; | ||
| codexProxyPort = 18744; | ||
| localProvider = port: models: { | ||
| baseUrl = "http://127.0.0.1:${toString port}/v1"; |
There was a problem hiding this comment.
Resolve the active proxy endpoint instead of fixing its port
After an Antigravity proxy artifact update, the existing A/B supervisor moves its listener from 18743 to 19743 and drains the old instance (bin/proxy-supervise.mjs:493-496,568-579), publishing the replacement URL in ~/.local/state/agy-proxy/endpoint.json. This provider URL remains fixed at 18743, so OpenClaw's Antigravity fallback becomes unavailable despite a healthy replacement proxy. The legacy service started through Wants does not recover after cutover because it has Restart = "no" (home/common/default.nix:508). Resolve the published endpoint or provide a stable forwarding endpoint so proxy updates do not strand the gateway.
Useful? React with 👍 / 👎.
| agents = { | ||
| defaults = { | ||
| model = { | ||
| primary = "commandcode/deepseek/deepseek-v4-flash"; |
There was a problem hiding this comment.
Use a tool-calling endpoint for the gateway's primary model
For requests requiring OpenClaw-native tools, this primary endpoint cannot return the necessary function calls. bin/commandcode-proxy.mjs:827-844 reduces supplied tools to a truncated name/description manifest, and line 248 instructs CommandCode to substitute its own file/shell tools; both response paths at lines 1174-1204 return only text with finish_reason: "stop", never tool_calls. Consequently normal agent turns cannot invoke OpenClaw's own tools, including the configured ACP delegation through sessions_spawn, and successful text responses do not trigger the fallback chain. Select a function-calling endpoint or implement a proper tool-call relay before using this proxy as the gateway's primary model.
Useful? React with 👍 / 👎.
The embedded acpx runtime ignores ~/.acpx/config.json; per-agent commands belong in plugins.entries.acpx.config.agents. Without the override acpx defaults to npx -y opencode-ai acp (upstream v1), which rejects the fleet v2 config and hangs on the flaky npmjs route during the backend startup check. Also trim acp.allowedAgents to opencode only (the check initializes every allowed agent; other harnesses are npx adapters for now). Verified: acpx backend ready, /acp spawn opencode creates a persistent session.
Installs OpenClaw (via github:openclaw/nix-openclaw) on the laptop as an on-boot Home Manager user service.
Upstream quirk: predeclared agents.entries.*.runtime ACP agents are rejected by the pinned nix-openclaw schema (runtime is a oneOf of submodules; minimal repro verified), so ACP agents spawn on demand via the top-level acp config — verified working.
Verified on amd: full flake eval passes; activation applied; openclaw-gateway active, enabled (linked) + linger, listening on the tailnet address; openclaw status healthy; agent smoke test answers with correct identity/fleet/default model; ACP end-to-end: embedded acpx backend ready and /acp spawn opencode created a persistent session on the fork build (v2.0.30+56590c5).
Canonical follow-up (Drew, whenever): sudo nixos-rebuild switch --flake ~/code#amd after merge, so the running config comes from main.