Skip to content

Following .NET quick start sample from readme throws internal exceptions "Unknown event type: session.usage_info" #38

@abpiskunov

Description

@abpiskunov

Exception thrown from request "(not specified)" for method session.event: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Text.Json.JsonException: Unknown event type: session.usage_info
at GitHub.Copilot.SDK.SessionEventConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.Deserialize(Utf8JsonReader& reader, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at GitHub.Copilot.SDK.SessionEvent.FromJson(String json)
at GitHub.Copilot.SDK.CopilotClient.RpcHandler.OnSessionEvent(String sessionId, Nullable1 event) at InvokeStub_RpcHandler.OnSessionEvent(Object, Span1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at StreamJsonRpc.TargetMethod.InvokeAsync(CancellationToken cancellationToken)
at StreamJsonRpc.JsonRpc.DispatchRequestAsync(JsonRpcRequest request, TargetMethod targetMethod, CancellationToken cancellationToken)
at StreamJsonRpc.JsonRpc.DispatchIncomingRequestAsync(JsonRpcRequest request)
JsonRpc Error: 10 : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Text.Json.JsonException: Unknown event type: session.usage_info
at GitHub.Copilot.SDK.SessionEventConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.Deserialize(Utf8JsonReader& reader, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at GitHub.Copilot.SDK.SessionEvent.FromJson(String json)
at GitHub.Copilot.SDK.CopilotClient.RpcHandler.OnSessionEvent(String sessionId, Nullable1 event) at InvokeStub_RpcHandler.OnSessionEvent(Object, Span1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at StreamJsonRpc.TargetMethod.InvokeAsync(CancellationToken cancellationToken)
at StreamJsonRpc.JsonRpc.DispatchRequestAsync(JsonRpcRequest request, TargetMethod targetMethod, CancellationToken cancellationToken)
at StreamJsonRpc.JsonRpc.DispatchIncomingRequestAsync(JsonRpcRequest request), session.event, (not specified),
The thread '.NET TP Worker' (51208) has exited with code 0 (0x0).
'Microsoft.UpgradeAssistant.Agents.Mcp.exe' (CoreCLR: clrhost): Loaded 'Z:\ProgramFiles\Microsoft Visual Studio\Dev18\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.NetCoreApp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions