mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 06:54:55 +00:00
test: align loopback prompt metadata
This commit is contained in:
@@ -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}",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user