{
  "agents": {
    "defaults": {
      "workspace": "~/.clawgo/workspace",
      "proxy": "proxy",
      "proxy_fallbacks": ["backup"],
      "max_tokens": 8192,
      "temperature": 0.7,
      "max_tool_iterations": 20,
      "heartbeat": {
        "enabled": true,
        "every_sec": 1800,
        "ack_max_chars": 64,
        "prompt_template": ""
      },
      "context_compaction": {
        "enabled": true,
        "mode": "summary",
        "trigger_messages": 60,
        "keep_recent_messages": 20,
        "max_summary_chars": 6000,
        "max_transcript_chars": 20000
      },
      "execution": {
        "run_state_ttl_seconds": 1800,
        "run_state_max": 500,
        "tool_parallel_safe_names": ["read_file", "list_files", "find_files", "grep_files", "memory_search", "web_search", "repo_map", "system_info"],
        "tool_max_parallel_calls": 2
      },
      "summary_policy": {
        "marker": "## System Task Summary",
        "completed_prefix": "- Completed:",
        "changes_prefix": "- Changes:",
        "outcome_prefix": "- Outcome:",
        "completed_title": "Completed Actions",
        "changes_title": "Change Summaries",
        "outcomes_title": "Execution Outcomes"
      }
    },
    "router": {
      "enabled": true,
      "main_agent_id": "main",
      "strategy": "rules_first",
      "policy": {
        "intent_max_input_chars": 1200,
        "max_rounds_without_user": 200
      },
      "rules": [
        {
          "agent_id": "coder",
          "keywords": ["代码", "实现", "修复", "重构", "bug", "debug", "implement", "refactor"]
        },
        {
          "agent_id": "tester",
          "keywords": ["测试", "回归", "验证", "test", "regression", "verify"]
        }
      ],
      "allow_direct_agent_chat": false,
      "max_hops": 6,
      "default_timeout_sec": 600,
      "default_wait_reply": true,
      "sticky_thread_owner": true
    },
    "communication": {
      "mode": "mediated",
      "persist_threads": true,
      "persist_messages": true,
      "max_messages_per_thread": 100,
      "dead_letter_queue": true,
      "default_message_ttl_sec": 86400
    },
    "subagents": {
      "main": {
        "enabled": true,
        "type": "router",
        "display_name": "Main Agent",
        "role": "orchestrator",
        "system_prompt_file": "agents/main/AGENT.md",
        "memory_namespace": "main",
        "accept_from": ["user", "coder", "tester"],
        "can_talk_to": ["coder", "tester"],
        "tools": {
          "allowlist": ["sessions", "subagents", "memory_search", "repo_map"]
        },
        "runtime": {
          "proxy": "proxy",
          "temperature": 0.2,
          "timeout_sec": 900,
          "max_retries": 1,
          "retry_backoff_ms": 1000,
          "max_parallel_runs": 4
        }
      },
      "coder": {
        "enabled": true,
        "type": "worker",
        "display_name": "Code Agent",
        "role": "code",
        "system_prompt_file": "agents/coder/AGENT.md",
        "memory_namespace": "coder",
        "accept_from": ["main", "tester"],
        "can_talk_to": ["main", "tester"],
        "tools": {
          "allowlist": ["filesystem", "shell", "repo_map", "sessions"]
        },
        "runtime": {
          "proxy": "proxy",
          "temperature": 0.2,
          "timeout_sec": 1200,
          "max_retries": 1,
          "retry_backoff_ms": 1000,
          "max_task_chars": 20000,
          "max_result_chars": 12000,
          "max_parallel_runs": 2
        }
      },
      "tester": {
        "enabled": true,
        "type": "worker",
        "display_name": "Test Agent",
        "role": "test",
        "system_prompt_file": "agents/tester/AGENT.md",
        "memory_namespace": "tester",
        "accept_from": ["main", "coder"],
        "can_talk_to": ["main", "coder"],
        "tools": {
          "allowlist": ["shell", "filesystem", "process_manager", "sessions"]
        },
        "runtime": {
          "proxy": "proxy",
          "temperature": 0.1,
          "timeout_sec": 1200,
          "max_retries": 1,
          "retry_backoff_ms": 1000,
          "max_parallel_runs": 2
        }
      },
      "node.edge-dev.main": {
        "enabled": true,
        "type": "worker",
        "transport": "node",
        "node_id": "edge-dev",
        "parent_agent_id": "main",
        "display_name": "Edge Dev Main Agent",
        "role": "remote_main",
        "memory_namespace": "node.edge-dev.main",
        "runtime": {
          "timeout_sec": 1200,
          "max_retries": 1,
          "retry_backoff_ms": 1000,
          "max_parallel_runs": 1
        }
      }
    }
  },
  "channels": {
    "inbound_message_id_dedupe_ttl_seconds": 600,
    "inbound_content_dedupe_window_seconds": 12,
    "outbound_dedupe_window_seconds": 12,
    "telegram": {
      "enabled": false,
      "token": "YOUR_TELEGRAM_BOT_TOKEN",
      "streaming": false,
      "allow_from": ["YOUR_USER_ID"],
      "allow_chats": [],
      "enable_groups": true,
      "require_mention_in_groups": true
    },
    "discord": {
      "enabled": false,
      "token": "YOUR_DISCORD_BOT_TOKEN",
      "allow_from": []
    },
    "maixcam": {
      "enabled": false,
      "host": "0.0.0.0",
      "port": 18790,
      "allow_from": []
    },
    "whatsapp": {
      "enabled": false,
      "bridge_url": "ws://localhost:3001",
      "allow_from": []
    },
    "feishu": {
      "enabled": false,
      "app_id": "",
      "app_secret": "",
      "encrypt_key": "",
      "verification_token": "",
      "allow_from": [],
      "allow_chats": [],
      "enable_groups": true,
      "require_mention_in_groups": true
    },
    "dingtalk": {
      "enabled": false,
      "client_id": "YOUR_CLIENT_ID",
      "client_secret": "YOUR_CLIENT_SECRET",
      "allow_from": []
    }
  },
  "providers": {
    "proxy": {
      "api_key": "YOUR_CLIPROXYAPI_KEY",
      "api_base": "http://localhost:8080/v1",
      "models": ["glm-4.7", "gpt-4o-mini"],
      "responses": {
        "web_search_enabled": false,
        "web_search_context_size": "",
        "file_search_vector_store_ids": [],
        "file_search_max_num_results": 0,
        "include": [],
        "stream_include_usage": false
      },
      "supports_responses_compact": false,
      "auth": "bearer",
      "timeout_sec": 90
    },
    "proxies": {
      "backup": {
        "api_key": "YOUR_BACKUP_PROXY_KEY",
        "api_base": "http://localhost:8081/v1",
        "models": ["gpt-4o-mini", "deepseek-chat"],
        "responses": {
          "web_search_enabled": false,
          "web_search_context_size": "",
          "file_search_vector_store_ids": [],
          "file_search_max_num_results": 0,
          "include": [],
          "stream_include_usage": false
        },
        "supports_responses_compact": true,
        "auth": "bearer",
        "timeout_sec": 90
      }
    }
  },
  "tools": {
    "filesystem": {},
    "shell": {
      "enabled": true,
      "working_dir": "",
      "timeout": 60000000000,
      "auto_install_missing": false,
      "sandbox": {
        "enabled": false,
        "image": "alpine:3.20"
      }
    },
    "web": {
      "search": {
        "api_key": "YOUR_BRAVE_API_KEY",
        "max_results": 5
      }
    }
  },
  "gateway": {
    "host": "0.0.0.0",
    "port": 18790,
    "token": ""
  },
  "cron": {
    "min_sleep_sec": 1,
    "max_sleep_sec": 30,
    "retry_backoff_base_sec": 30,
    "retry_backoff_max_sec": 1800,
    "max_consecutive_failure_retries": 5,
    "max_workers": 4
  },
  "logging": {
    "enabled": true,
    "dir": "~/.clawgo/logs",
    "filename": "clawgo.log",
    "max_size_mb": 20,
    "retention_days": 3
  }
}
