refactor(agent): dedupe harness and command workflows

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:09 +00:00
parent 04892ee230
commit f717a13039
204 changed files with 7366 additions and 11540 deletions

View File

@@ -0,0 +1,35 @@
import { vi } from "vitest";
export type LoadedConfig = ReturnType<(typeof import("../config/config.js"))["loadConfig"]>;
export const callGatewayMock = vi.fn();
const defaultConfig: LoadedConfig = {
session: {
mainKey: "main",
scope: "per-sender",
},
};
let configOverride: LoadedConfig = defaultConfig;
export function setSubagentsConfigOverride(next: LoadedConfig) {
configOverride = next;
}
export function resetSubagentsConfigOverride() {
configOverride = defaultConfig;
}
vi.mock("../gateway/call.js", () => ({
callGateway: (opts: unknown) => callGatewayMock(opts),
}));
vi.mock("../config/config.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("../config/config.js")>();
return {
...actual,
loadConfig: () => configOverride,
resolveGatewayPort: () => 18789,
};
});