test: dedupe auto-reply web and signal flows

This commit is contained in:
Peter Steinberger
2026-02-22 17:11:26 +00:00
parent ad1072842e
commit 24ea941e28
12 changed files with 399 additions and 391 deletions

View File

@@ -6,13 +6,15 @@ import {
getCompactEmbeddedPiSessionMock,
getRunEmbeddedPiAgentMock,
installTriggerHandlingE2eTestHooks,
loadGetReplyFromConfig,
makeCfg,
mockRunEmbeddedPiAgentOk,
withTempHome,
} from "./reply.triggers.trigger-handling.test-harness.js";
let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig;
beforeAll(async () => {
({ getReplyFromConfig } = await import("./reply.js"));
getReplyFromConfig = await loadGetReplyFromConfig();
});
installTriggerHandlingE2eTestHooks();
@@ -92,13 +94,7 @@ describe("trigger handling", () => {
});
it("ignores think directives that only appear in the context wrapper", async () => {
await withTempHome(async (home) => {
getRunEmbeddedPiAgentMock().mockResolvedValue({
payloads: [{ text: "ok" }],
meta: {
durationMs: 1,
agentMeta: { sessionId: "s", provider: "p", model: "m" },
},
});
mockRunEmbeddedPiAgentOk();
const res = await getReplyFromConfig(
{
@@ -127,13 +123,7 @@ describe("trigger handling", () => {
});
it("does not emit directive acks for heartbeats with /think", async () => {
await withTempHome(async (home) => {
getRunEmbeddedPiAgentMock().mockResolvedValue({
payloads: [{ text: "ok" }],
meta: {
durationMs: 1,
agentMeta: { sessionId: "s", provider: "p", model: "m" },
},
});
mockRunEmbeddedPiAgentOk();
const res = await getReplyFromConfig(
{