Skip to content

fix(dotnet): add AgentId to SessionEvent base class#1181

Open
IeuanWalker wants to merge 2 commits intogithub:mainfrom
IeuanWalker:main
Open

fix(dotnet): add AgentId to SessionEvent base class#1181
IeuanWalker wants to merge 2 commits intogithub:mainfrom
IeuanWalker:main

Conversation

@IeuanWalker
Copy link
Copy Markdown

Add the AgentId property to the SessionEvent base class in the .NET SDK, matching the agentId field present on all event interfaces in the Node.js generated types. This allows consumers to identify which sub-agent emitted a given event, replacing the deprecated ParentToolCallId pattern.

Fixes #1169

Add the AgentId property to the SessionEvent base class in the .NET SDK,
matching the agentId field present on all event interfaces in the Node.js
generated types. This allows consumers to identify which sub-agent emitted
a given event, replacing the deprecated ParentToolCallId pattern.

The C# code generator (scripts/codegen/csharp.ts) was updated to emit this
property when regenerating SessionEvents.cs.

Fixes github#1169
@IeuanWalker IeuanWalker requested a review from a team as a code owner April 30, 2026 18:51
Copilot AI review requested due to automatic review settings April 30, 2026 18:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds AgentId to the .NET SDK’s SessionEvent base type so event consumers can identify which (sub-)agent emitted an event, aligning with the agentId field available on Node.js event interfaces and providing a replacement path for the deprecated ParentToolCallId linkage pattern.

Changes:

  • Update C# session-events codegen to emit SessionEvent.AgentId with correct JSON annotations.
  • Regenerate dotnet/src/Generated/SessionEvents.cs to include the new AgentId property on the SessionEvent base class.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/codegen/csharp.ts Emits agentId on the generated C# SessionEvent base class.
dotnet/src/Generated/SessionEvents.cs Adds the generated AgentId property to SessionEvent with JSON serialization attributes and XML docs.

Comment thread dotnet/src/Generated/SessionEvents.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParentToolCallId obsolete

2 participants