Skip to content

fix: openclaw refactor, qmd activation, and arm64 platform fix - #1459

Merged
shunkakinoki merged 4 commits into
mainfrom
openclaw-refactor
Apr 12, 2026
Merged

fix: openclaw refactor, qmd activation, and arm64 platform fix#1459
shunkakinoki merged 4 commits into
mainfrom
openclaw-refactor

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add AMP, Factory Droid, and Codex agents to openclaw configuration with hooks and memory scope
  • Fix qmd activate.sh to check for existing wiki collection before adding
  • Move qwen-code package behind aarch64-linux exclusion guard to fix arm64 Docker build

Test plan

  • Verify shellspec tests pass (qmd activate.sh collection list check)
  • Verify arm64 Docker build succeeds with qwen-code excluded
  • Verify openclaw templates render correctly with new agents

Summary by cubic

Adds AMP, Factory Droid, and Codex agents to OpenClaw and enables webhooks with a GitHub mapping to improve automation. Also fixes qmd activation idempotency and arm64 builds by gating qwen-code.

  • New Features

    • Add amp, factory (via droid), and codex agents with persistent ACP runtime.
    • Enable hooks with __HOOKS_TOKEN__, /hooks, and a GitHub → dev-gpt mapping; hydrate reads the token. Set memory.qmd.scope.default to allow.
  • Bug Fixes

    • Make qmd activation idempotent by checking existing collections before adding.
    • Fix arm64 builds by excluding qwen-code on aarch64-linux. Add xdg-utils and update deps (including droid).

Written for commit 9101b86. Summary will update on new commits.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 12, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: beed0785-8a54-4c62-8576-12971e7095ce

📥 Commits

Reviewing files that changed from the base of the PR and between b7726c2 and 9101b86.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • config/openclaw/hydrate.sh
  • config/openclaw/openclaw.template.json
  • config/openclaw/openclaw.tpl.json
  • home-manager/packages/default.nix
  • home-manager/services/qmd/activate.sh
  • package.json

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Three new agents introduced: AMP (Sourcegraph), Factory Droid, and Codex (GPT) with persistent runtime support.
    • Hooks configuration added with GitHub webhook integration and WhatsApp message delivery capability.
    • Default memory scope configuration implemented for permissions management.
  • Bug Fixes

    • Improved collection management logic to check existing collections before adding.
  • Chores

    • Updated package availability based on platform architecture.
    • Added new dependency.

Walkthrough

This pull request extends OpenClaw's gateway mode configuration by adding hooks token resolution in the hydration script, introducing three new ACP-backed agents (amp, factory, codex) and a GitHub webhook integration, adding memory permission scopes, making qwen-code platform-conditional, conditionally checking wiki collection status, and adding the droid dependency.

Changes

Cohort / File(s) Summary
OpenClaw Gateway & Hooks Configuration
config/openclaw/hydrate.sh
Added resolution of HOOKS_TOKEN from environment or secrets directory in gateway mode, with template substitution of __HOOKS_TOKEN__ placeholder in the generated configuration.
OpenClaw Template Configuration
config/openclaw/openclaw.template.json, config/openclaw/openclaw.tpl.json
Extended templates with memory permission scopes (memory.qmd.scope.default: "allow"), three new ACP agents (amp, factory, codex) with persistent runtime configuration and workspace paths, and webhook hooks configuration mapping GitHub events to the dev-gpt agent with WhatsApp delivery.
Package & Service Management
home-manager/packages/default.nix, home-manager/services/qmd/activate.sh
Restricted qwen-code availability to non-aarch64 architectures, added xdg-utils to Linux packages, and made wiki collection registration conditional on collection not already existing.
Dependencies
package.json
Added droid (^0.99.0) to both dependencies and trustedDependencies allowlist.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 Three agents hop into the fold,
With hooks that catch what stories told,
Qwen-code wisely chooses its ground,
While droid brings new magic around! 🪄

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch openclaw-refactor

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.

@shunkakinoki
shunkakinoki merged commit ef170d9 into main Apr 12, 2026
29 of 31 checks passed
@shunkakinoki
shunkakinoki deleted the openclaw-refactor branch April 12, 2026 17:11
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 12, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Refactored Openclaw by integrating new agents, fixed QMD activation logic, and resolved an ARM64 platform build issue.

What changed?

  • Added AMP, Factory Droid, and Codex agents to openclaw configuration with hooks and memory scope.
  • Fixed qmd activate.sh to check for existing wiki collection before adding.
  • Moved qwen-code package behind aarch64-linux exclusion guard to fix arm64 Docker build.

Description generated by Mesa. Update settings

@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 adds several new dependencies including droid and btca, introduces new agent configurations for amp, factory, and codex, and implements a GitHub webhook system for WhatsApp notifications. It also refines architecture-specific package management and improves the idempotency of the qmd service activation script. Feedback focuses on enhancing the robustness of directory matching in shell scripts using exact grep matching and replacing hardcoded WhatsApp recipient IDs with configurable placeholders in the configuration templates.

# Add wiki collection (idempotent - ignore if already exists)
"$QMD_BIN" collection add "$WIKI_DIR" 2>/dev/null || true
# Add wiki collection only if not already registered
if ! "$QMD_BIN" collection list 2>/dev/null | grep -qF "$WIKI_DIR"; then

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

Use grep -qxF to ensure an exact match of the directory path. Using grep -F without the -x flag can result in false positives if the $WIKI_DIR string is a substring of another registered path (e.g., matching /path/to/wiki when checking for /path/to/wik). This ensures robust matching of command output.

Suggested change
if ! "$QMD_BIN" collection list 2>/dev/null | grep -qF "$WIKI_DIR"; then
if ! "$QMD_BIN" collection list 2>/dev/null | grep -qxF "$WIKI_DIR"; then
References
  1. To robustly parse command output in shell scripts, use methods that avoid partial matches or incorrect splitting, ensuring consistency and reliability.
  2. Maintain consistency with established patterns for writing scripts that are extracted from Nix expressions.

TELEGRAM_TOKEN="${OPENCLAW_TELEGRAM_TOKEN:-${TELEGRAM_TOKEN:-$(read_secret "${SECRETS_DIR}/telegram-token")}}"
WHATSAPP_ALLOW_FROM="${OPENCLAW_WHATSAPP_ALLOW_FROM:-${WHATSAPP_ALLOW_FROM:-$(read_secret "${SECRETS_DIR}/whatsapp-allow-from")}}"
ANTHROPIC_API_KEY="${OPENCLAW_ANTHROPIC_API_KEY:-${ANTHROPIC_API_KEY:-$(read_secret "${SECRETS_DIR}/anthropic-key")}}"
HOOKS_TOKEN="${OPENCLAW_HOOKS_TOKEN:-${HOOKS_TOKEN:-$(read_secret "${SECRETS_DIR}/hooks-token")}}"

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

To avoid hardcoding specific recipient IDs in the template files, define a variable for the WhatsApp hook recipient that can be populated from an environment variable or a secret.

Suggested change
HOOKS_TOKEN="${OPENCLAW_HOOKS_TOKEN:-${HOOKS_TOKEN:-$(read_secret "${SECRETS_DIR}/hooks-token")}}"
HOOKS_TOKEN="${OPENCLAW_HOOKS_TOKEN:-${HOOKS_TOKEN:-$(read_secret "${SECRETS_DIR}/hooks-token")}}"
WHATSAPP_HOOK_RECIPIENT="${OPENCLAW_WHATSAPP_HOOK_RECIPIENT:-${WHATSAPP_HOOK_RECIPIENT:-$(read_secret "${SECRETS_DIR}/whatsapp-hook-recipient")}}"

-e "s|__CLIPROXY_API_KEY__|${CLIPROXY_API_KEY}|g" \
-e "s|__TELEGRAM_TOKEN__|${TELEGRAM_TOKEN}|g" \
-e "s|__WHATSAPP_ALLOW_FROM__|${WHATSAPP_ALLOW_FROM}|g" \
-e "s|__HOOKS_TOKEN__|${HOOKS_TOKEN}|g" \

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

Add a substitution rule for the WhatsApp hook recipient placeholder to maintain consistency with other configurable tokens.

Suggested change
-e "s|__HOOKS_TOKEN__|${HOOKS_TOKEN}|g" \
-e "s|__HOOKS_TOKEN__|${HOOKS_TOKEN}|g" \
-e "s|__WHATSAPP_HOOK_RECIPIENT__|${WHATSAPP_HOOK_RECIPIENT}|g" \

"messageTemplate": "GitHub {{headers.x-github-event}} event on {{repository.full_name}}:\n\nAction: {{action}}\nSender: {{sender.login}}\n\n{{pull_request.title}}{{issue.title}}\n\n{{pull_request.html_url}}{{issue.html_url}}",
"deliver": true,
"channel": "whatsapp",
"to": "120363405790595065@g.us"

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 WhatsApp recipient ID is hardcoded. Use a placeholder to allow for environment-specific configuration via the hydrate.sh script, which improves maintainability and keeps the template generic.

Suggested change
"to": "120363405790595065@g.us"
"to": "__WHATSAPP_HOOK_RECIPIENT__"

"messageTemplate": "GitHub {{headers.x-github-event}} event on {{repository.full_name}}:\n\nAction: {{action}}\nSender: {{sender.login}}\n\n{{pull_request.title}}{{issue.title}}\n\n{{pull_request.html_url}}{{issue.html_url}}",
"deliver": true,
"channel": "whatsapp",
"to": "120363405790595065@g.us"

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 WhatsApp recipient ID is hardcoded. Use a placeholder to allow for environment-specific configuration via the hydrate.sh script, which improves maintainability and keeps the template generic.

Suggested change
"to": "120363405790595065@g.us"
"to": "__WHATSAPP_HOOK_RECIPIENT__"

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.

1 participant