mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
test(auto-reply): share subagent dispatch context
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
@@ -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"],
|
||||
});
|
||||
|
||||
@@ -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"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user