fix(dotnet): add AgentId to SessionEvent base class#1181
Open
IeuanWalker wants to merge 2 commits intogithub:mainfrom
Open
fix(dotnet): add AgentId to SessionEvent base class#1181IeuanWalker wants to merge 2 commits intogithub:mainfrom
IeuanWalker wants to merge 2 commits intogithub:mainfrom
Conversation
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
Contributor
There was a problem hiding this comment.
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.AgentIdwith correct JSON annotations. - Regenerate
dotnet/src/Generated/SessionEvents.csto include the newAgentIdproperty on theSessionEventbase 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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