You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #99 added AgentsAPI\AI\Channels\WP_Agent_Channel, which gives direct webhook-style transports a reusable way to run a chat ability and deliver a response:
These systems overlap around the same primitive: send one user message to one WP agent, optionally continue a session, and return assistant output.
Problem
The minimum contract exists, but it is not yet documented as a durable Agents API contract, and it does not yet describe the richer metadata that real channels and remote bridges need:
attachments
source/client context
external provider/channel identity
external conversation/thread ID
external message ID for idempotency
room kind (dm, group, channel)
optional runtime metadata/tool/turn information
Without documenting the base contract and defining its bridge-ready extension points, each runtime will keep growing incompatible variants (openclawp/chat, datamachine/send-message, future Intelligence chat ability, etc.).
Current shapes
openclawp/chat aligns with the minimum WP_Agent_Channel contract:
Decide whether extract_replies() should also understand response as a common alias for reply, since Data Machine uses that field today.
Leave runtimes free to register adapters behind the contract (openclawp/chat, Data Machine, Intelligence, etc.).
Why this belongs in agents-api
The overlap is now visible in at least two implementations. A documented contract makes WP_Agent_Channel and future remote bridge APIs portable without forcing every channel or bridge to hard-code runtime-specific ability shapes.
Context
PR #99 added
AgentsAPI\AI\Channels\WP_Agent_Channel, which gives direct webhook-style transports a reusable way to run a chat ability and deliver a response:That PR already establishes the minimum chat ability call shape used by
WP_Agent_Channel::run_agent():and
WP_Agent_Channel::deliver_result()already understands these output shapes:or:
The first consumer is Miguel's openclaWP wacli transport:
Data Machine has a parallel bridge entry point through
datamachine/send-messageindata-machine-chat-bridge:These systems overlap around the same primitive: send one user message to one WP agent, optionally continue a session, and return assistant output.
Problem
The minimum contract exists, but it is not yet documented as a durable Agents API contract, and it does not yet describe the richer metadata that real channels and remote bridges need:
dm,group,channel)Without documenting the base contract and defining its bridge-ready extension points, each runtime will keep growing incompatible variants (
openclawp/chat,datamachine/send-message, future Intelligence chat ability, etc.).Current shapes
openclawp/chataligns with the minimumWP_Agent_Channelcontract:{ "agent": "agent-slug", "message": "text", "session_id": "optional" }and returns:
{ "session_id": "uuid", "reply": "assistant text", "completed": true }datamachine/send-messageaccepts a richer shape:{ "message": "text", "agent_id": 123, "session_id": "optional", "attachments": [], "client_context": {} }and returns Data Machine's chat response shape (
session_id,response,completed, metadata/tool data, etc.).Proposal
Document the existing minimum
WP_Agent_Channelchat ability contract, then extend it in a backward-compatible way for bridge/channel metadata.Base input, already used by
WP_Agent_Channel:{ "agent": "agent-slug", "message": "text", "session_id": "optional" }Bridge-ready input extension:
{ "agent": "agent-slug-or-id", "message": "text", "session_id": "optional", "attachments": [], "client_context": { "source": "channel|bridge|rest|block", "client_name": "wacli", "external_provider": "whatsapp", "external_conversation_id": "opaque-room-id", "external_message_id": "opaque-message-id", "room_kind": "dm|group|channel" } }Base output, already understood by
WP_Agent_Channel:{ "session_id": "uuid", "reply": "assistant text", "completed": true }Optional richer output:
{ "session_id": "uuid", "reply": "assistant text", "messages": [], "completed": true, "metadata": {} }Acceptance criteria
WP_Agent_Channelchat ability input/output contract as the minimum portable contract.attachments,client_context) without breaking existing ability implementations.WP_Agent_Channel::run_agent()should pass normalizedclient_contextonce issue Add normalized channel message and session mapping primitives #102 lands.extract_replies()should also understandresponseas a common alias forreply, since Data Machine uses that field today.openclawp/chat, Data Machine, Intelligence, etc.).Why this belongs in agents-api
The overlap is now visible in at least two implementations. A documented contract makes
WP_Agent_Channeland future remote bridge APIs portable without forcing every channel or bridge to hard-code runtime-specific ability shapes.Related issues: