   cat << 'EOF' > /tmp/test_feishu_appid.sh
   #!/bin/bash

   # 临时测试脚本 - 在 Ubuntu 服务器上运行

   CONFIG_FILE="/home/ubuntu/openclaw-config/openclaw-qiangwu/openclaw.json"

   echo "=== Test 1: File exists? ==="
   if [ -f "$CONFIG_FILE" ]; then
       echo "✓ File exists"
   else
       echo "✗ File not found"
       exit 1
   fi

   echo ""
   echo "=== Test 2: Python can read it? ==="
   python3 << PYEOF
   import json
   with open('$CONFIG_FILE', 'r') as f:
       data = json.load(f)
       print("✓ JSON parsed successfully")
       print(f"Top-level keys: {list(data.keys())}")
   PYEOF

   echo ""
   echo "=== Test 3: Extract appId with debug ==="
   python3 - "$CONFIG_FILE" << 'PYEOF'
   import json
   import sys

   config_file = sys.argv[1]
   print(f"Reading: {config_file}", file=sys.stderr)

   with open(config_file, 'r', encoding='utf-8') as f:
       data = json.load(f)

       channels = data.get('channels', {})
       feishu = channels.get('feishu', {})
       accounts = feishu.get('accounts', {})

       print(f"Found {len(accounts)} accounts", file=sys.stderr)

       if accounts:
           for account_name, account_data in accounts.items():
               print(f"Account: {account_name}", file=sys.stderr)
               app_id = account_data.get('appId', '')
               print(f"AppId: '{app_id}'", file=sys.stderr)
               if app_id:
                   print(app_id)  # This goes to stdout
                   sys.exit(0)

       print("No appId found", file=sys.stderr)
       print('-')
   PYEOF

   echo ""
   echo "=== Test 4: Full function test ==="
   get_feishu_appid() {
       local config_file="$1"

       if [ ! -f "$config_file" ]; then
           echo "-"
           return
       fi

       local app_id
       app_id=$(python3 - "$config_file" << 'PYEOF' 2>/dev/null
   import json
   import sys

   config_file = sys.argv[1]

   try:
       with open(config_file, 'r', encoding='utf-8') as f:
           data = json.load(f)
           channels = data.get('channels', {})
           feishu = channels.get('feishu', {})
           accounts = feishu.get('accounts', {})

           if accounts:
               for account_name, account_data in accounts.items():
                   app_id = account_data.get('appId', '')
                   if app_id:
                       print(app_id)
                       sys.exit(0)

           app_id = feishu.get('app-id', '')
           if app_id:
               print(app_id)
               sys.exit(0)

           print('-')
   except Exception as e:
       print('-')
       sys.exit(1)
   PYEOF
   ) || app_id="-"

       echo "$app_id"
   }

   RESULT=$(get_feishu_appid "$CONFIG_FILE")
   echo "Result: '$RESULT'"

   if [ "$RESULT" = "-" ]; then
       echo "✗ Failed to extract appId"
   else
       echo "✓ Success: $RESULT"
   fi
   EOF

   cat /tmp/test_feishu_appid.sh
   EOF
