test: remove duplicate inbound-meta coverage from reply-flow

This commit is contained in:
Peter Steinberger
2026-02-19 07:41:38 +00:00
parent 7e54b6c96f
commit ff1189c6d6

View File

@@ -2,10 +2,9 @@ import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { expectInboundContextContract } from "../../../test/helpers/inbound-contract.js";
import type { OpenClawConfig } from "../../config/config.js";
import { defaultRuntime } from "../../runtime.js";
import type { MsgContext, TemplateContext } from "../templating.js";
import type { MsgContext } from "../templating.js";
import { HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN } from "../tokens.js";
import { finalizeInboundContext } from "./inbound-context.js";
import { buildInboundUserContextPrefix } from "./inbound-meta.js";
import { normalizeInboundTextNewlines } from "./inbound-text.js";
import { parseLineDirectives, hasLineDirectives } from "./line-directives.js";
import type { FollowupRun, QueueSettings } from "./queue.js";
@@ -13,27 +12,6 @@ import { enqueueFollowupRun, scheduleFollowupDrain } from "./queue.js";
import { createReplyDispatcher } from "./reply-dispatcher.js";
import { createReplyToModeFilter, resolveReplyToMode } from "./reply-threading.js";
describe("buildInboundUserContextPrefix", () => {
it("omits conversation label block for direct chats", () => {
const text = buildInboundUserContextPrefix({
ChatType: "direct",
ConversationLabel: "openclaw-tui",
} as TemplateContext);
expect(text).toBe("");
});
it("keeps conversation label for group chats", () => {
const text = buildInboundUserContextPrefix({
ChatType: "group",
ConversationLabel: "ops-room",
} as TemplateContext);
expect(text).toContain("Conversation info (untrusted metadata):");
expect(text).toContain('"conversation_label": "ops-room"');
});
});
describe("normalizeInboundTextNewlines", () => {
it("converts CRLF to LF", () => {
expect(normalizeInboundTextNewlines("hello\r\nworld")).toBe("hello\nworld");