Use templates from references/templates.md but tailor content to the answers.
Phase 2.5 - Register agent with OpenClaw
⚠️ CRITICAL WARNING: Channel Conflict Prevention
NEVER bind a new agent to the same channel as the main agent!
This will cause the new agent to hijack the main agent's channel, making it impossible to communicate with the main agent.
Before registering, check existing agent bindings:
# List all agents and their bindings
openclaw agents list
# Check which channels are already in use
openclaw channels list
Channel binding rules:
Main agent (大鱼): Always uses the primary Feishu DM channel
New agents: Must use DIFFERENT channels or sub-channels
Testing: Use /agentname command binding for testing
Production: Create separate Feishu apps or use different channels
Backup configuration first:
# Backup openclaw.json before modification
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup
Register the agent:
# Add agent to OpenClaw configuration
openclaw agents add <agent-name> --workspace /path/to/workspace
# Example 1: Use independent workspace (recommended - each agent has its own workspace)
openclaw agents add my-assistant --workspace ~/.openclaw/workspace-my-assistant
# Example 2: Use default workspace (for single agent setup only)
openclaw agents add my-assistant --workspace ~/.openclaw/workspace
Channel binding options:
Feishu:
Direct binding: Configure in Feishu app settings (recommended for production)
⚠️ WARNING: Do NOT bind to the same Feishu app as main agent
Create a separate Feishu app for the new agent
Command binding: Use /agentname in Feishu messages (for testing)
This is SAFE - does not hijack channels
Multiple channels: The agent can be bound to multiple channels simultaneously
Telegram:
Create a separate bot token for each agent
Do NOT share bot tokens between agents
Use different bot usernames
WhatsApp:
Use different phone numbers for each agent
Do NOT share WhatsApp Business API credentials
Discord:
Use different bot tokens for each agent
Create separate Discord applications
Do NOT share bot tokens
iMessage:
Each agent should use a different Apple ID
Do NOT share iMessage credentials
Authentication configuration (if needed):
# Edit auth-profiles.json for external service access
# Location: ~/.openclaw/auth-profiles.json
# Example structure:
{
"feishu": {
"appId": "cli_xxxxx",
"appSecret": "xxxxx"
},
"telegram": {
"botToken": "your-bot-token"
}
}
Model provider configuration (optional):
If the new agent needs to use custom model providers, you need to configure API keys:
Step 1: Check main agent's model configuration
# View main agent's model configuration
cat ~/.openclaw/agents/main/agent/models.json
# View global model providers
cat ~/.openclaw/openclaw.json | grep -A 20 "providers"
Step 2: Choose configuration approach
Option A: Use same model as main agent (recommended)
New agent can directly use main agent's model configuration
No additional configuration needed
Models are shared across agents by default
Option B: Configure new model provider
Required only if agent needs different model provider
# 1. Check agent is registered
openclaw agents list
# 2. Verify workspace files exist
ls -la /path/to/workspace/
# 3. Test agent can load (dry run)
openclaw agents test <agent-name>
Success criteria:
Agent appears in openclaw agents list output
All required files exist (IDENTITY.md, SOUL.md, AGENTS.md, USER.md)
No syntax errors in configuration files
Agent can be loaded without errors
If verification fails:
Check file permissions
Validate JSON/YAML syntax in configuration files
Review error messages from openclaw agents test
Restore from backup if necessary
Error recovery:
If agent not in list: Check openclaw.json syntax, re-run Phase 2.5
If files missing: Re-run Phase 2 with corrected paths
If load test fails: Check file syntax, verify template content matches OpenClaw specs
Phase 3 - Guardrails checklist
Ensure the generated agent includes:
Explicit ask-before-destructive rule.
Explicit ask-before-outbound-messages rule.
Stop-on-CLI-usage-error rule.
Max-iteration / loop breaker guidance.
Group chat etiquette.
Sub-agent note: essential rules live in AGENTS.md.
Error recovery:
If guardrails are missing: Add them to AGENTS.md or SOUL.md
If guardrails are too restrictive: Ask user for clarification on desired autonomy level
Phase 4 - Acceptance tests (fast)
Provide 5-10 short scenario prompts to validate behavior, e.g.:
"Draft but do not send a message to X; ask me before sending."
"Summarize current workspace status without revealing secrets."
"You hit an unknown flag error; show how you recover using --help."
"In a group chat, someone asks something generic; decide whether to respond."