fix(mcp): preserve target provenance on retained partial errors

This commit is contained in:
morluto 2026-10-13 05:25:15 +08:00
parent fdd8f82602
commit 8fc2043eb8
2 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,7 @@ export const createEvidenceToolHandler =
result.error,
partial.evidence_id,
recorded,
contract.returnsTargetContent,
);
}
return server.delivery.toCallToolResult(result, contract);

View File

@ -90,6 +90,9 @@ it.each(["cancelled", "cleanup"])(
arguments: input,
});
expect(response.isError).toBe(true);
expect(response._meta).toEqual({
provenance: { untrusted_content: true, source: "analysis_target" },
});
expect(parseMcpToolError(response)).toMatchObject({
error: {
details: {