Channel inbound API
기준일: 2026-07-26
공식 기준: Channel inbound API
Channel inbound API 문서는 OpenClaw 공식 문서(plugins/sdk-channel-inbound)를 한국어로 정리한 가이드입니다. Inbound event helpers for channel plugins: context building, shared runner orchestration, session record, and prepared reply dispatch 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
Inbound event helpers for channel plugins: context building, shared runner orchestration, session record, and prepared reply dispatch
한국어 가이드 범위: plugins/sdk-channel-inbound 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- Core helpers
- Delivery settlement contract
- Migration
상세 내용
본문
Use openclaw/plugin-sdk/channel-inbound for inbound event normalization, formatting, roots, and orchestration. Use openclaw/plugin-sdk/channel-outbound for native send, receipt, durable delivery, and live preview behavior.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
platform event -> inbound facts/context -> agent reply -> message delivery
Core helpers
into the prompt/session context. Pass channel-owned sender/chat metadata through channelContext, which plugin hooks see as ctx.channelContext. Augment PluginHookChannelSenderContext or PluginHookChannelChatContext from this subpath for channel-specific fields.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
buildChannelInboundEventContext(...): projects normalized channel factsrunChannelInboundEvent(...): runs ingest, classify, preflight, resolve,dispatchChannelInboundReply(...): records and dispatches an already
buildChannelInboundEventContext,
runChannelInboundEvent,
dispatchChannelInboundReply,
} from "openclaw/plugin-sdk/channel-inbound";
const media = toInboundMediaFacts([
{ path: saved.path, url: nativeUrl, contentType: saved.contentType, messageId },
]);
const ctx = finalizeInboundContext({ Body: caption, media });
await runtime.channel.inbound.run({
channel: "demo",
accountId,
raw: platformEvent,
adapter: {
ingest: normalizePlatformEvent,
resolveTurn: resolveInboundReply,
},
});
Delivery settlement contract
ChannelInboundTurnPlan.delivery owns the native send for each logical reply payload. Core owns outbound hook ordering and, when the adapter opts in, terminal message_sent observation. Keep those responsibilities separate so one payload cannot produce duplicate terminal events.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
| Field | Contract |
|---|---|
content |
Provider-accepted visible text for the logical payload after native formatting or finalization. Omit it to use the prepared payload text for terminal observation. Media-only sends can omit it. |
messageIds / receipt |
Actual provider identities for the visible send. Prefer a MessageReceipt; core uses its primary provider id for message_sent. |
visibleReplySent |
Set to false only when the provider produced no visible preview or final message. Core does not emit a successful message_sent for that result. |
finalization |
A promise for delayed native settlement of the same logical payload, such as closing or editing an in-place streaming card. Its resolved fields override the immediate result before terminal observation and onDelivered. |
throw createChannelPartialDeliveryError(cause, {
visibleReplySent: true,
content: finalizedVisibleText,
receipt,
});
Migration
runtime.channel.turn.* runtime aliases were removed. Use:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
runtime.channel.inbound.run(...)for raw inbound events.runtime.channel.inbound.dispatchReply(...)for assembled reply contexts.runtime.channel.inbound.buildContext(...)for inbound context payloads.runtime.channel.inbound.runPreparedReply(...), deprecated, only for
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/plugins/sdk-channel-inbound - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
platform event -> inbound facts/context -> agent reply -> message delivery
buildChannelInboundEventContext,
runChannelInboundEvent,
dispatchChannelInboundReply,
} from "openclaw/plugin-sdk/channel-inbound";
const media = toInboundMediaFacts([
{ path: saved.path, url: nativeUrl, contentType: saved.contentType, messageId },
]);
const ctx = finalizeInboundContext({ Body: caption, media });
await runtime.channel.inbound.run({
channel: "demo",
accountId,
raw: platformEvent,
adapter: {
ingest: normalizePlatformEvent,
resolveTurn: resolveInboundReply,
},
});
throw createChannelPartialDeliveryError(cause, {
visibleReplySent: true,
content: finalizedVisibleText,
receipt,
});
관련 링크
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.