Skip to content

https://github.com/github/copilot-sdk/issues/880#issuecomment-4090919851 #895

@annadonnawalters-cpu

Description

@annadonnawalters-cpu

3_agent.txt

Duplicate of #> Original approach: Custom UnknownSessionEvent type + TryFromJson wrapper method in runtime code.

New approach: Set IgnoreUnrecognizedTypeDiscriminators = true on the [JsonPolymorphic] attribute and make SessionEvent non-abstract. Unknown event types now deserialize as the base SessionEvent with Type = "unknown" — no custom types or runtime code changes needed.

The fix is a 3-line change in the codegen script (scripts/codegen/csharp.ts) plus the regenerated output.

Originally posted by @Ron537 in #880

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions