refactor: drop legacy session store keys

This commit is contained in:
Peter Steinberger
2026-01-17 06:48:34 +00:00
parent 353d778988
commit 37a2eee837
22 changed files with 65 additions and 93 deletions

View File

@@ -1,6 +1,7 @@
import { normalizeChatType } from "../../channels/chat-type.js";
import { resolveConversationLabel } from "../../channels/conversation-label.js";
import type { MsgContext } from "../templating.js";
import { formatInboundBodyWithSenderMeta } from "./inbound-sender-meta.js";
import { normalizeInboundTextNewlines } from "./inbound-text.js";
export type FinalizeInboundContextOptions = {
@@ -55,5 +56,13 @@ export function finalizeInboundContext<T extends Record<string, unknown>>(
normalized.ConversationLabel = explicitLabel;
}
// Ensure group/channel messages retain a sender meta line even when the body is a
// structured envelope (e.g. "[Signal ...] Alice: hi").
normalized.Body = formatInboundBodyWithSenderMeta({ ctx: normalized, body: normalized.Body });
normalized.BodyForAgent = formatInboundBodyWithSenderMeta({
ctx: normalized,
body: normalized.BodyForAgent,
});
return normalized;
}