refactor: normalize inbound context

This commit is contained in:
Peter Steinberger
2026-01-17 04:04:05 +00:00
parent 9f4b7a1683
commit a2b5b1f0cb
31 changed files with 155 additions and 35 deletions

View File

@@ -356,11 +356,16 @@ export async function monitorMatrixProvider(opts: MonitorMatrixOpts = {}): Promi
const groupSystemPrompt = roomConfigInfo.config?.systemPrompt?.trim() || undefined;
const ctxPayload = {
Body: body,
BodyForAgent: body,
RawBody: bodyText,
CommandBody: bodyText,
BodyForCommands: bodyText,
From: isDirectMessage ? `matrix:${senderId}` : `matrix:channel:${roomId}`,
To: `room:${roomId}`,
SessionKey: route.sessionKey,
AccountId: route.accountId,
ChatType: isDirectMessage ? "direct" : "room",
ChatType: isDirectMessage ? "direct" : "channel",
ConversationLabel: envelopeFrom,
SenderName: senderName,
SenderId: senderId,
SenderUsername: senderId.split(":")[0]?.replace(/^@/, ""),