fix(mcp): preserve migrated revisions and valid links
This commit is contained in:
@@ -155,8 +155,8 @@ describe("persistent cross-version investigation workspace", () => {
|
||||
});
|
||||
|
||||
expect(migrated).toMatchObject({
|
||||
revision: current.revision + 1,
|
||||
previous_revision_digest: legacyDigest,
|
||||
revision: current.revision,
|
||||
previous_revision_digest: current.previous_revision_digest,
|
||||
runs: [
|
||||
{
|
||||
legacy_request_identity: true,
|
||||
@@ -174,9 +174,11 @@ describe("persistent cross-version investigation workspace", () => {
|
||||
throw new TypeError("legacy fixture is not canonical");
|
||||
await writeFile(input.workspace_path, encodedLegacy, { mode: 0o600 });
|
||||
await expect(
|
||||
runCrossVersionInvestigation(input, policy(directory), {
|
||||
inputRoots: [directory],
|
||||
}),
|
||||
runCrossVersionInvestigation(
|
||||
{ ...input, expected_workspace_revision: current.revision },
|
||||
policy(directory),
|
||||
{ inputRoots: [directory] },
|
||||
),
|
||||
).resolves.toMatchObject({ ok: true, value: { reused: true } });
|
||||
await expect(
|
||||
runCrossVersionInvestigation(
|
||||
|
||||
@@ -164,6 +164,11 @@ describe("official Hopper proxy tools", () => {
|
||||
arguments: VALID_INPUTS[contract.name],
|
||||
});
|
||||
expect(result.isError).not.toBe(true);
|
||||
expect(result.content).not.toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ type: "resource_link" }),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
expect(invocations.map(({ name }) => name)).toEqual(
|
||||
|
||||
@@ -61,7 +61,7 @@ describe("tool result projection", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("links successful evidence to its session resource URI", () => {
|
||||
it("links successful evidence only when its session resource exists", () => {
|
||||
const evidence = createEvidence(
|
||||
undefined,
|
||||
{ id: "fixture", name: "Fixture", version: "1" },
|
||||
@@ -79,6 +79,15 @@ describe("tool result projection", () => {
|
||||
|
||||
expect(
|
||||
toCallToolResult(ok(evidence), evidenceContract).content,
|
||||
).not.toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ type: "resource_link" }),
|
||||
]),
|
||||
);
|
||||
expect(
|
||||
toCallToolResult(ok(evidence), evidenceContract, {
|
||||
evidenceResourcesAvailable: true,
|
||||
}).content,
|
||||
).toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: "resource_link",
|
||||
|
||||
Reference in New Issue
Block a user