fix(coding-agent): complete Agent Hub inspector metadata
This commit is contained in:
@@ -2,6 +2,7 @@ import { afterEach, describe, expect, it, vi } from "bun:test";
|
||||
import * as fs from "node:fs/promises";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import { AgentRegistry } from "@oh-my-pi/pi-coding-agent/registry/agent-registry";
|
||||
import * as executorModule from "@oh-my-pi/pi-coding-agent/task/executor";
|
||||
import {
|
||||
applyEligibleNestedPatches,
|
||||
@@ -73,6 +74,7 @@ async function seedFooRepo(finalContent: string): Promise<{ repoRoot: string; pa
|
||||
describe("runIsolatedSubprocess", () => {
|
||||
afterEach(async () => {
|
||||
vi.restoreAllMocks();
|
||||
AgentRegistry.resetGlobalForTests();
|
||||
await Promise.all(tempRoots.splice(0).map(tempRoot => fs.rm(tempRoot, { force: true, recursive: true })));
|
||||
});
|
||||
|
||||
@@ -107,6 +109,13 @@ describe("runIsolatedSubprocess", () => {
|
||||
nestedPatches: [],
|
||||
});
|
||||
const cleanupSpy = vi.spyOn(worktreeModule, "cleanupIsolation").mockResolvedValue();
|
||||
AgentRegistry.global().register({
|
||||
id: "PreserveBranchFailure",
|
||||
displayName: "PreserveBranchFailure",
|
||||
kind: "sub",
|
||||
session: null,
|
||||
status: "parked",
|
||||
});
|
||||
const deleteSpy = vi.spyOn(gitModule.branch, "tryDelete").mockResolvedValue(true);
|
||||
|
||||
const outcome = await runIsolatedSubprocess({
|
||||
@@ -138,6 +147,7 @@ describe("runIsolatedSubprocess", () => {
|
||||
expect(captureSpy).toHaveBeenCalledWith(isolationDir, baseline);
|
||||
expect(deleteSpy).toHaveBeenCalledWith(repoRoot, "omp/task/PreserveBranchFailure");
|
||||
expect(cleanupSpy).toHaveBeenCalledTimes(1);
|
||||
expect(AgentRegistry.global().get("PreserveBranchFailure")?.history?.patchPath).toBe(patchPath);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user