-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Labels
.NETv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-frameworkRelated to Workflows in agent-framework
Description
Registration appears to require the exact message Type, as it's just looked up in a dictionary by that type. I expect that if I have a route handler for IEnumerable<T>, then anything that implements IEnumerable<T> should satisfy it, or if I have a handler for List<T>, List<T> or anything deriving from it should satisfy it, but that is not happening.
Repro:
[Fact]
public async Task ReproAsync()
{
var workflow = new WorkflowBuilder(new StartExecutor()).Build<IEnumerable<string>>();
StreamingRun run = await InProcessExecution.StreamAsync<IEnumerable<string>>(workflow, ["Hello, World!"]);
await run.RunToCompletionAsync();
}
private sealed class StartExecutor : Executor
{
protected override RouteBuilder ConfigureRoutes(RouteBuilder routeBuilder) =>
routeBuilder.AddHandler<IEnumerable<string>>(async (msg, ctx) =>
{
Debugger.Break();
Console.WriteLine("In StartExecutor");
await ctx.SendMessageAsync(msg);
});
}Result:
System.NotSupportedException : No handler found for message type <>z__ReadOnlySingleElementList`1 in executor StartExecutor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
.NETv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GAworkflowsRelated to Workflows in agent-frameworkRelated to Workflows in agent-framework
Type
Projects
Status
Done