-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rysweet-unsubscribe-and-agent-tests-4744 #4920
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 105 out of 120 changed files in this pull request and generated 3 comments.
Files not reviewed (15)
- dotnet/AutoGen.sln: Language not supported
- dotnet/Directory.Packages.props: Language not supported
- dotnet/samples/dev-team/DevTeam.AgentHost/DevTeam.AgentHost.csproj: Language not supported
- dotnet/samples/dev-team/DevTeam.AgentHost/Properties/launchSettings.json: Language not supported
- dotnet/samples/dev-team/DevTeam.AgentHost/appsettings.Development.json: Language not supported
- dotnet/samples/dev-team/DevTeam.Agents/DevTeam.Agents.csproj: Language not supported
- dotnet/samples/dev-team/DevTeam.Agents/Properties/launchSettings.json: Language not supported
- dotnet/samples/dev-team/DevTeam.Agents/appsettings.Development.json: Language not supported
- dotnet/samples/dev-team/DevTeam.AgentHost/Program.cs: Evaluated as low risk
- dotnet/samples/dev-team/DevTeam.Agents/Developer/Developer.cs: Evaluated as low risk
- dotnet/samples/dev-team/DevTeam.Agents/DeveloperLead/DeveloperLead.cs: Evaluated as low risk
- dotnet/samples/dev-team/DevTeam.Agents/ProductManager/ProductManager.cs: Evaluated as low risk
- dotnet/samples/dev-team/DevTeam.Agents/Program.cs: Evaluated as low risk
- README.md: Evaluated as low risk
- dotnet/samples/Hello/HelloAIAgents/Program.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
dotnet/samples/Hello/HelloAgent/Program.cs:59
- The
SayHello
method now accepts aCancellationToken
, but theHandle
method does not pass thecancellationToken
to it. Ensure that thecancellationToken
is propagated correctly.
public async Task<string> SayHello(string ask, CancellationToken cancellationToken = default)
typeRegistry), | ||
IHandleConsole, | ||
IHandle<NewMessageReceived>, | ||
IHandle<ConversationClosed>, | ||
IHandle<Shutdown> | ||
{ | ||
private AgentState? State { get; set; } | ||
public async Task Handle(NewMessageReceived item) | ||
public async Task Handle(NewMessageReceived item, CancellationToken cancellationToken = default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CancellationToken parameter is not being used within the method to handle cancellation.
public async Task Handle(NewMessageReceived item, CancellationToken cancellationToken = default) | |
var response = await SayHello(item.Message, cancellationToken).ConfigureAwait(false); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -57,7 +55,7 @@ await StoreAsync(new AgentState | |||
await PublishMessageAsync(new Shutdown { Message = this.AgentId.Key }).ConfigureAwait(false); | |||
|
|||
} | |||
public async Task Handle(ConversationClosed item) | |||
public async Task Handle(ConversationClosed item, CancellationToken cancellationToken = default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CancellationToken parameter is not being used within the method to handle cancellation.
public async Task Handle(ConversationClosed item, CancellationToken cancellationToken = default) | |
State = await ReadAsync<AgentState>(this.AgentId, cancellationToken).ConfigureAwait(false); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -74,7 +72,7 @@ await StoreAsync(new AgentState | |||
TextData = JsonSerializer.Serialize(state) | |||
}).ConfigureAwait(false); | |||
} | |||
public async Task Handle(Shutdown item) | |||
public async Task Handle(Shutdown item, CancellationToken cancellationToken = default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CancellationToken parameter is not being used within the method to handle cancellation.
public async Task Handle(Shutdown item, CancellationToken cancellationToken = default) | |
await Task.Delay(0, cancellationToken); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4920 +/- ##
==========================================
- Coverage 68.37% 68.34% -0.04%
==========================================
Files 157 157
Lines 10078 10102 +24
==========================================
+ Hits 6891 6904 +13
- Misses 3187 3198 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
repeated string events = 3; | ||
repeated string topics = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what these are for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allows for complete subscription management from registration vs after I think - I've asked Kosta to comment. this was part of his refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, at the point of registration we (at least on the .net side) know all of the events/topics the agent is interested in, no reason to do separate grpc calls to pass that information.
RegisterAgentTypeRequest registerAgentTypeRequest = 4; | ||
RegisterAgentTypeResponse registerAgentTypeResponse = 5; | ||
AddSubscriptionRequest addSubscriptionRequest = 6; | ||
AddSubscriptionResponse addSubscriptionResponse = 7; | ||
SubscriptionRequest SubscriptionRequest = 6; | ||
SubscriptionResponse SubscriptionResponse = 7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If registration and subscription is to be done with direct RPC then these message can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed we wanted to support both for the time being this late in the game. does that make sense @jackgerrits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my refactor, those are removed.
Why are these changes needed?
adds unsubscribe api
adds tests for most all of Agent and AgentWorker
Related issue number
closes #4744
closes #4357
Checks