Skip to content
이 페이지는 AI의 도움으로 작성 및 번역되었습니다. 부정확한 내용이 있으면 개선에 참여해 주세요. GitHub에서 편집

에이전트 타입

에이전트는 OpenPR-Webhook의 핵심 디스패치 단위입니다. 각 에이전트는 매칭된 웹훅 이벤트를 처리하는 방법을 정의합니다. 단일 배포에 여러 에이전트를 설정할 수 있으며, 이벤트는 웹훅 페이로드의 bot_context에 따라 적절한 에이전트로 라우팅됩니다.

개요

타입사용 사례기능 플래그 필요
openclawOpenClaw CLI를 사용하여 Signal/Telegram으로 알림 전송없음
openprxOpenPRX Signal API 또는 CLI를 통해 메시지 전송없음
webhookHTTP 엔드포인트(Slack, Discord 등)로 이벤트 전달없음
custom임의 셸 명령 실행없음
cliAI 코딩 에이전트(codex, claude-code, opencode) 실행예 (cli_enabled)

에이전트 설정 구조

모든 에이전트에는 다음 공통 필드가 있습니다:

toml
[[agents]]
id = "unique-id"              # Unique identifier, used for matching
name = "Human-Readable Name"  # Display name, also used for matching
agent_type = "openclaw"       # One of: openclaw, openprx, webhook, custom, cli
message_template = "..."      # Optional: custom message format

그런 다음 agent_type에 따라 타입별 설정 블록을 제공합니다:

  • openclaw 에이전트의 경우 [agents.openclaw]
  • openprx 에이전트의 경우 [agents.openprx]
  • webhook 에이전트의 경우 [agents.webhook]
  • custom 에이전트의 경우 [agents.custom]
  • cli 에이전트의 경우 [agents.cli]

메시지 템플릿

message_template 필드는 웹훅 페이로드의 값으로 대체되는 플레이스홀더를 지원합니다:

플레이스홀더출처예시
{event}payload.eventissue.updated
{title}payload.data.issue.titleFix login bug
{key}payload.data.issue.keyPROJ-42
{issue_id}payload.data.issue.id123
{reason}payload.bot_context.trigger_reasonassigned_to_bot
{actor}payload.actor.namealice
{project}payload.project.namebackend
{workspace}payload.workspace.nameIM
{state}payload.data.issue.statein_progress
{priority}payload.data.issue.priorityhigh
{url}파생issue/123

기본 템플릿 (openclaw, openprx, webhook, custom용):

[{project}] {event}: {key} {title}
{actor} | Trigger: {reason}

에이전트 매칭 로직

bot_context.is_bot_task = true인 웹훅 이벤트가 도착하면:

  1. 서비스는 bot_context.bot_namebot_context.bot_agent_type을 추출합니다
  2. id 또는 name(대소문자 무시)이 bot_name과 일치하는 에이전트를 검색합니다
  3. 이름 매칭이 없으면 agent_typebot_agent_type과 일치하는 첫 번째 에이전트로 폴백합니다
  4. 에이전트가 전혀 매칭되지 않으면 이벤트는 수신 확인되지만 디스패치되지 않습니다

멀티 에이전트 예제

toml
# Agent 1: Notification via Telegram
[[agents]]
id = "notify-tg"
name = "Telegram Notifier"
agent_type = "openclaw"
message_template = "[{project}] {event}: {key} {title}"

[agents.openclaw]
command = "/usr/local/bin/openclaw"
channel = "telegram"
target = "@my-channel"

# Agent 2: Forward to Slack
[[agents]]
id = "notify-slack"
name = "Slack Forwarder"
agent_type = "webhook"

[agents.webhook]
url = "https://hooks.slack.com/services/T.../B.../xxx"

# Agent 3: MCP 폐루프를 사용하는 AI 코딩 에이전트
[[agents]]
id = "coder"
name = "Code Agent"
agent_type = "cli"

[agents.cli]
executor = "claude-code"
workdir = "/opt/projects/backend"
timeout_secs = 600
skip_callback_state = true  # AI가 MCP를 통해 직접 상태 업데이트

[agents.cli.env_vars]
OPENPR_API_URL = "http://localhost:3000"
OPENPR_BOT_TOKEN = "opr_xxx"

이 설정에서 OpenPR은 웹훅 페이로드의 bot_name 필드를 설정하여 다른 이벤트를 다른 에이전트로 라우팅할 수 있습니다.

다음 단계

Released under the Apache-2.0 License.