Skip to content

.NET: [Bug]: Approval response false throwing error in AGUI Client #6220

Description

@Mohanr1122

Description

if we sending approval response as false, getting error "System.Text.Json.JsonException: ''T' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.'" in AGUI Client

Image

Code Sample

Error Messages / Stack Traces

System.Text.Json.JsonException
  HResult=0x80131500
  Message='T' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
  Source=System.Text.Json
  StackTrace:
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsObject(Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpanAsObject(ReadOnlySpan`1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable`1 actualByteCount)
   at System.Text.Json.JsonSerializer.ReadFromSpanAsObject(ReadOnlySpan`1 json, JsonTypeInfo jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Deserialize(String json, JsonTypeInfo jsonTypeInfo)
   at Microsoft.Agents.AI.AGUI.Shared.ChatResponseUpdateAGUIExtensions.DeserializeResultIfAvailable(ToolCallResultEvent toolCallResult, JsonSerializerOptions options)
   at Microsoft.Agents.AI.AGUI.Shared.ChatResponseUpdateAGUIExtensions.ToolCallBuilder.EmitToolCallResult(ToolCallResultEvent toolCallResult, JsonSerializerOptions options)
   at Microsoft.Agents.AI.AGUI.Shared.ChatResponseUpdateAGUIExtensions.<AsChatResponseUpdatesAsync>d__2.MoveNext()
   at Microsoft.Agents.AI.AGUI.Shared.ChatResponseUpdateAGUIExtensions.<AsChatResponseUpdatesAsync>d__2.MoveNext()
   at Microsoft.Agents.AI.AGUI.Shared.ChatResponseUpdateAGUIExtensions.<AsChatResponseUpdatesAsync>d__2.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.Agents.AI.AGUI.AGUIChatClient.AGUIChatClientHandler.<GetStreamingResponseAsync>d__9.MoveNext()
   at Microsoft.Agents.AI.AGUI.AGUIChatClient.AGUIChatClientHandler.<GetStreamingResponseAsync>d__9.MoveNext()
   at Microsoft.Agents.AI.AGUI.AGUIChatClient.AGUIChatClientHandler.<GetStreamingResponseAsync>d__9.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.Extensions.AI.FunctionInvokingChatClient.<GetStreamingResponseAsync>d__42.MoveNext()
   at Microsoft.Extensions.AI.FunctionInvokingChatClient.<GetStreamingResponseAsync>d__42.MoveNext()
   at Microsoft.Extensions.AI.FunctionInvokingChatClient.<GetStreamingResponseAsync>d__42.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.Agents.AI.AGUI.AGUIChatClient.<GetStreamingResponseAsync>d__4.MoveNext()
   at Microsoft.Agents.AI.AGUI.AGUIChatClient.<GetStreamingResponseAsync>d__4.MoveNext()
   at Microsoft.Agents.AI.AGUI.AGUIChatClient.<GetStreamingResponseAsync>d__4.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.Agents.AI.ChatClientAgent.<RunCoreStreamingAsync>d__29.MoveNext()
   at Microsoft.Agents.AI.ChatClientAgent.<RunCoreStreamingAsync>d__29.MoveNext()
   at Microsoft.Agents.AI.ChatClientAgent.<RunCoreStreamingAsync>d__29.MoveNext()
   at Microsoft.Agents.AI.ChatClientAgent.<RunCoreStreamingAsync>d__29.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.Agents.AI.AIAgent.<RunStreamingAsync>d__33.MoveNext()
   at Microsoft.Agents.AI.AIAgent.<RunStreamingAsync>d__33.MoveNext()
   at Microsoft.Agents.AI.AIAgent.<RunStreamingAsync>d__33.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at ServerFunctionApprovalClientAgent.<RunCoreStreamingAsync>d__3.MoveNext() in \agent-framework-main\dotnet\samples\02-agents\AGUI\Step04_HumanInLoop\Client\ServerFunctionApprovalClientAgent.cs:line 45
   at ServerFunctionApprovalClientAgent.<RunCoreStreamingAsync>d__3.MoveNext() in agent-framework-main\dotnet\samples\02-agents\AGUI\Step04_HumanInLoop\Client\ServerFunctionApprovalClientAgent.cs:line 45
   at ServerFunctionApprovalClientAgent.<RunCoreStreamingAsync>d__3.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.Agents.AI.AIAgent.<RunStreamingAsync>d__33.MoveNext()
   at Microsoft.Agents.AI.AIAgent.<RunStreamingAsync>d__33.MoveNext()
   at Microsoft.Agents.AI.AIAgent.<RunStreamingAsync>d__33.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Program.<<Main>$>d__0.MoveNext() in agent-framework-main (1)\agent-framework-main\dotnet\samples\02-agents\AGUI\Step04_HumanInLoop\Client\Program.cs:line 55
   at Program.<<Main>$>d__0.MoveNext() in agent-framework-main (1)\agent-framework-main\dotnet\samples\02-agents\AGUI\Step04_HumanInLoop\Client\Program.cs:line 55

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
JsonReaderException: 'T' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

Package Versions

Microsoft.Agents.AI 1.6.2

.NET Version

No response

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .Netag-uiUsage: [Issues, PRs], Target: AG-UI protocol integrationbugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)reproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions