The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
import { describe, expect, it } from "vitest";
import {
failedSecretProposalInteraction,
pendingSecretProposalInteraction,
} from "../fixtures/issueThreadInteractionFixtures";
import { replaceResolvedInteraction } from "./AttentionInteractionResolver";
describe("replaceResolvedInteraction", () => {
it("immediately replaces a pending secret proposal with its stitched failure receipt", () => {
const resolved = {
...failedSecretProposalInteraction,
id: pendingSecretProposalInteraction.id,
};
const next = replaceResolvedInteraction([pendingSecretProposalInteraction], resolved);
expect(next).toHaveLength(1);
expect(next[0]?.status).toBe("accepted");
expect(next[0]?.kind).toBe("request_confirmation");
if (next[0]?.kind === "request_confirmation") {
expect(next[0].result?.secretProposal).toMatchObject({
status: "failed",
errorCode: "binding_snapshot_stale",
});
}
});
it("retains the stitched receipt when the interaction cache was empty", () => {
expect(replaceResolvedInteraction(undefined, failedSecretProposalInteraction)).toEqual([
failedSecretProposalInteraction,
]);
});
});