test(auto-reply): share subagent dispatch context

This commit is contained in:
Vincent Koc
2026-04-12 05:04:39 +01:00
parent e6706fa530
commit f2f98d5613
3 changed files with 15 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
import { buildSubagentsSendContext } from "./commands-subagents.test-helpers.js";
export function buildSubagentsDispatchContext(params: {
handledPrefix: string;
restTokens: string[];
}) {
return buildSubagentsSendContext({
handledPrefix: params.handledPrefix,
restTokens: params.restTokens,
});
}

View File

@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { buildSubagentsSendContext } from "./commands-subagents.test-helpers.js";
import { buildSubagentsDispatchContext } from "./commands-subagents-send-steer.test-support.js";
import { handleSubagentsSendAction } from "./commands-subagents/action-send.js";
const sendControlledSubagentMessageMock = vi.hoisted(() => vi.fn());
@@ -11,7 +11,7 @@ vi.mock("./commands-subagents-control.runtime.js", () => ({
}));
const buildContext = () =>
buildSubagentsSendContext({
buildSubagentsDispatchContext({
handledPrefix: "/subagents",
restTokens: ["1", "continue", "with", "follow-up", "details"],
});

View File

@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { buildSubagentsSendContext } from "./commands-subagents.test-helpers.js";
import { buildSubagentsDispatchContext } from "./commands-subagents-send-steer.test-support.js";
import { handleSubagentsSendAction } from "./commands-subagents/action-send.js";
const sendControlledSubagentMessageMock = vi.hoisted(() => vi.fn());
@@ -11,7 +11,7 @@ vi.mock("./commands-subagents-control.runtime.js", () => ({
}));
const buildContext = () =>
buildSubagentsSendContext({
buildSubagentsDispatchContext({
handledPrefix: "/steer",
restTokens: ["1", "check", "timer.ts", "instead"],
});