Make relevant object disposable and improve exception handling.

This commit is contained in:
Peter Ibekwe
2026-04-20 18:28:04 -07:00
Unverified
parent 70507e9a44
commit 9e7dcab50c
@@ -94,11 +94,11 @@ internal sealed class InvokeAzureAgentExecutor(InvokeAzureAgent model, ResponseA
{
try
{
JsonDocument jsonDocument = JsonDocument.Parse(lastMessageText);
using JsonDocument jsonDocument = JsonDocument.Parse(lastMessageText);
Dictionary<string, object?> objectProperties = jsonDocument.ParseRecord(VariableType.RecordType);
await this.AssignAsync(this.AgentOutput?.ResponseObject?.Path, objectProperties.ToFormula(), context).ConfigureAwait(false);
}
catch
catch (JsonException)
{
// Not valid json, skip assignment.
}