fix(a2a): reject malformed file part URLs as prompt errors

This commit is contained in:
EugeneTes
2026-10-07 12:41:55 +00:00
parent ee06e84cd5
commit ab4af2cc21
2 changed files with 10 additions and 1 deletions

View File

@@ -33,6 +33,14 @@ public sealed class PromptTests : IDisposable
Assert.Equal("hello", File.ReadAllText(Path.Combine(_ws, relative)));
}
[Fact]
public async Task Files_BadUrl_Throws()
{
var part = Part.FromUrl("not a url", "text/plain", null);
await Assert.ThrowsAsync<A2APromptException>(() =>
A2APrompt.BuildAsync(Caller, Msg(part), 1024, new HttpClient(), TimeProvider.System, default));
}
[Fact]
public async Task DataPart_BecomesFencedJson()
{