mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-25 20:33:58 +02:00
Configure the sidecar LSP tool serializer with a DefaultJsonTypeInfoResolver and freeze it read-only before handing it to AIFunctionFactory. Add regression coverage so enabling LSP-backed tools cannot reintroduce the runtime JsonSerializerOptions failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
28 lines
685 B
C#
28 lines
685 B
C#
using System.Text.Json;
|
|
using Eryx.AgentHost.Services;
|
|
|
|
namespace Eryx.AgentHost.Tests;
|
|
|
|
public sealed class LspToolSessionTests
|
|
{
|
|
[Fact]
|
|
public void CreateJsonSerializerOptions_ReturnsReadOnlyResolverBackedOptions()
|
|
{
|
|
JsonSerializerOptions options = LspToolSession.CreateJsonSerializerOptions();
|
|
|
|
Assert.True(options.IsReadOnly);
|
|
Assert.NotNull(options.TypeInfoResolver);
|
|
|
|
string json = JsonSerializer.Serialize(
|
|
new
|
|
{
|
|
RelativePath = "src/file.ts",
|
|
Line = 12,
|
|
Character = 4,
|
|
},
|
|
options);
|
|
|
|
Assert.Contains("relativePath", json);
|
|
}
|
|
}
|