test: speed up isolated-agent and pty test suites

This commit is contained in:
Peter Steinberger
2026-02-16 03:58:39 +00:00
parent 3fe22ea2fd
commit 25dc4293bf
3 changed files with 29 additions and 40 deletions

View File

@@ -166,6 +166,8 @@ vi.mock("../../agents/defaults.js", () => ({
DEFAULT_PROVIDER: "openai",
}));
const { runCronIsolatedAgentTurn } = await import("./run.js");
// ---------- helpers ----------
function makeJob(overrides?: Record<string, unknown>) {
@@ -230,8 +232,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
it("passes agent-level skillFilter to buildWorkspaceSkillSnapshot", async () => {
resolveAgentSkillsFilterMock.mockReturnValue(["meme-factory", "weather"]);
const { runCronIsolatedAgentTurn } = await import("./run.js");
const result = await runCronIsolatedAgentTurn(
makeParams({
cfg: { agents: { list: [{ id: "scout", skills: ["meme-factory", "weather"] }] } },
@@ -250,8 +250,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
it("omits skillFilter when agent has no skills config", async () => {
resolveAgentSkillsFilterMock.mockReturnValue(undefined);
const { runCronIsolatedAgentTurn } = await import("./run.js");
const result = await runCronIsolatedAgentTurn(
makeParams({
cfg: { agents: { list: [{ id: "general" }] } },
@@ -268,8 +266,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
it("passes empty skillFilter when agent explicitly disables all skills", async () => {
resolveAgentSkillsFilterMock.mockReturnValue([]);
const { runCronIsolatedAgentTurn } = await import("./run.js");
const result = await runCronIsolatedAgentTurn(
makeParams({
cfg: { agents: { list: [{ id: "silent", skills: [] }] } },
@@ -302,8 +298,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
isNewSession: true,
});
const { runCronIsolatedAgentTurn } = await import("./run.js");
const result = await runCronIsolatedAgentTurn(
makeParams({
cfg: { agents: { list: [{ id: "weather-bot", skills: ["weather"] }] } },
@@ -338,8 +332,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
isNewSession: true,
});
const { runCronIsolatedAgentTurn } = await import("./run.js");
const result = await runCronIsolatedAgentTurn(
makeParams({
cfg: { agents: { list: [{ id: "weather-bot", skills: ["weather", "meme-factory"] }] } },