test: align loopback prompt metadata

This commit is contained in:
Peter Steinberger
2026-05-26 22:38:22 -04:00
parent 166097e564
commit f7a39f487c
2 changed files with 3 additions and 2 deletions

View File

@@ -95,6 +95,7 @@ function createTestMcpLoopbackServerConfig(port: number) {
"x-openclaw-account-id": "${OPENCLAW_MCP_ACCOUNT_ID}",
"x-openclaw-message-channel": "${OPENCLAW_MCP_MESSAGE_CHANNEL}",
"x-openclaw-inbound-event-kind": "${OPENCLAW_MCP_INBOUND_EVENT_KIND}",
"x-openclaw-source-reply-delivery-mode": "${OPENCLAW_MCP_SOURCE_REPLY_DELIVERY_MODE}",
},
},
},

View File

@@ -10,7 +10,7 @@ import { appendUntrustedContext } from "./untrusted-context.js";
const REPLY_MEDIA_HINT =
"To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg (spaces ok, quote if needed) or a safe relative path like MEDIA:./image.jpg. Absolute and ~ paths only work when they stay inside your allowed file-read boundary; host file:// URLs are blocked. Keep caption in the text body.";
const ROOM_EVENT_PROMPT = "[OpenClaw room event]";
const ROOM_EVENT_VISIBLE_REPLY_CONTRACT = "message_tool_only";
const ROOM_EVENT_SOURCE_REPLY_DELIVERY_MODE = "message_tool_only";
export function buildReplyPromptBodies(params: {
ctx: MsgContext;
@@ -134,7 +134,7 @@ function buildRoomEventContext(params: ReplyPromptEnvelopeBaseParams): string {
return [
"[OpenClaw room event]",
"inbound_event_kind: room_event",
`visible_reply_contract: ${ROOM_EVENT_VISIBLE_REPLY_CONTRACT}`,
`visible_reply_contract: ${ROOM_EVENT_SOURCE_REPLY_DELIVERY_MODE}`,
params.inboundUserContext.trim() ? `Room context:\n${params.inboundUserContext.trim()}` : "",
`Current event:\n${formatRoomEventLine(params.sessionCtx, roomEventBody)}`,
"Treat this as observed room activity. Decide whether to act.",