fix: openclaw refactor, qmd activation, and arm64 platform fix - #1459
Conversation
…tion fix: update dependencies and add xdg-utils to home-manager packages
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Mesa DescriptionTL;DRRefactored Openclaw by integrating new agents, fixed QMD activation logic, and resolved an ARM64 platform build issue. What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
| 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
- To robustly parse command output in shell scripts, use methods that avoid partial matches or incorrect splitting, ensuring consistency and reliability.
- 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")}}" |
There was a problem hiding this comment.
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.
| 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" \ |
There was a problem hiding this comment.
| "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" |
There was a problem hiding this comment.
| "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" |
There was a problem hiding this comment.
Summary
Test plan
Summary by cubic
Adds AMP, Factory Droid, and Codex agents to OpenClaw and enables webhooks with a GitHub mapping to improve automation. Also fixes
qmdactivation idempotency and arm64 builds by gatingqwen-code.New Features
amp,factory(viadroid), andcodexagents with persistent ACP runtime.__HOOKS_TOKEN__,/hooks, and a GitHub →dev-gptmapping; hydrate reads the token. Setmemory.qmd.scope.defaultto allow.Bug Fixes
qmdactivation idempotent by checking existing collections before adding.qwen-codeonaarch64-linux. Addxdg-utilsand update deps (includingdroid).Written for commit 9101b86. Summary will update on new commits.