Files
aitbc/scripts/workflow-openclaw/fix_agent_communication.sh
aitbc fb460816e4
All checks were successful
API Endpoint Tests / test-api-endpoints (push) Successful in 38s
Documentation Validation / validate-docs (push) Successful in 10s
Integration Tests / test-service-integration (push) Successful in 57s
Python Tests / test-python (push) Successful in 1m32s
Security Scanning / security-scan (push) Successful in 1m7s
fix: standardize exchange database path to use centralized data directory with environment variable
🔧 Database Path Standardization:
• Change DATABASE_URL environment variable to EXCHANGE_DATABASE_URL
• Update default database path from ./exchange.db to /var/lib/aitbc/data/exchange/exchange.db
• Apply consistent path resolution across all exchange database connections
• Update database.py, seed_market.py, and simple_exchange_api.py with new path
• Maintain backward compatibility through
2026-03-30 13:34:20 +02:00

61 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# OpenClaw Agent Communication Fix
# This script demonstrates the correct way to use OpenClaw agents with sessions
set -e
echo "=== OpenClaw Agent Communication Fix ==="
# 1. Check OpenClaw status
echo "1. Checking OpenClaw status..."
openclaw status --all | head -10
# 2. Create a session for agent operations
echo "2. Creating agent session for blockchain operations..."
SESSION_ID="blockchain-workflow-$(date +%s)"
# 3. Test agent communication with session
echo "3. Testing agent communication with proper session..."
openclaw agent --agent main --session-id $SESSION_ID --message "Test agent communication for blockchain workflow" --thinking low
echo "✅ Agent communication working with session ID: $SESSION_ID"
# 4. Demonstrate agent coordination
echo "4. Demonstrating agent coordination for blockchain operations..."
openclaw agent --agent main --session-id $SESSION_ID --message "Coordinate multi-node blockchain deployment and provide status analysis" --thinking medium
# 5. Show session information
echo "5. Session information:"
echo "Session ID: $SESSION_ID"
echo "Agent: main"
echo "Status: Active"
# 6. Generate fix report
cat > /tmp/openclaw_agent_fix_report.json << EOF
{
"fix_status": "completed",
"issue": "Agent communication failed due to missing session context",
"solution": "Added --session-id parameter to agent commands",
"session_id": "$SESSION_ID",
"agent_id": "main",
"working_commands": [
"openclaw agent --agent main --session-id \$SESSION_ID --message 'task'",
"openclaw agent --agent main --session-id \$SESSION_ID --message 'task' --thinking medium"
],
"timestamp": "$(date -Iseconds)"
}
EOF
echo "✅ OpenClaw Agent Communication Fix Completed!"
echo "📊 Report saved to: /tmp/openclaw_agent_fix_report.json"
echo ""
echo "=== Correct Usage Examples ==="
echo "# Basic agent communication:"
echo "openclaw agent --agent main --session-id $SESSION_ID --message 'your task'"
echo ""
echo "# With thinking level:"
echo "openclaw agent --agent main --session-id $SESSION_ID --message 'complex task' --thinking high"
echo ""
echo "# For blockchain operations:"
echo "openclaw agent --agent main --session-id $SESSION_ID --message 'coordinate blockchain deployment' --thinking medium"