Limitation Details
- Only workflows and agents that are dependency injected can be visualized in the DevUI.
Workflows must be registered using the agents using AddAsAIAgent to be visualized and funcational.
- Non agentic workflows must take ChatMessage as input in order to run the workflow in the DevUI.
- Conversations API failes if agents in not dependency injected but the parent workflow is.
- Non agentic workflow should be named using the
WithName (provide name param for agentic workflow), which must match the workflow name in the dependency injection registration.
- Chat History/Agent Thread is not maintaince
- By default, only AgentsAsExecutor can be executed in the DevUI; otherwise, every executor should be inherited from
ChatProtocolExecutor or needs to support getting both List<ChatMessage> and TurnToken as input. See the sample below:
// Disclaimer: This might not be the intended way to implement an executor, but is a workaround to make it work in DevUI.
internal sealed class UppercaseExecutor() : Executor("UppercaseExecutor")
{
private List<ChatMessage> _messages = [];
protected override Microsoft.Agents.AI.Workflows.RouteBuilder ConfigureRoutes(Microsoft.Agents.AI.Workflows.RouteBuilder routeBuilder)
{
return routeBuilder
.AddHandler<List<ChatMessage>>(this.RouteMessages)
.AddHandler<TurnToken, string>(this.RouteTurnTokenAsync); // here `string` is the input type of the next executor (output of this)
// Add your orginal input type as a new handler here
}
private ValueTask RouteMessages(List<ChatMessage> messages, IWorkflowContext context, CancellationToken cancellationToken)
{
this._messages = messages;
return ValueTask.CompletedTask;
}
private ValueTask<string> RouteTurnTokenAsync(TurnToken token, IWorkflowContext context, CancellationToken cancellationToken)
{
// Not sure why DevUI wraps the actual input this way...
return ValueTask.FromResult(JsonDocument.Parse(this._messages.Last().Text).RootElement.GetProperty("input").GetString()!.ToUpperInvariant());
}
}
- Details about inner agents (Agents inside Executor) itself like Tools calls will not be shown
Expectation
- For errors/exceptions, DevUI should show a toast message or some indication of what went wrong instead of just failing silently.
- DevUI should support non agentic workflows and executors more seamlessly without the need for workarounds.
- Simplify the process of registering and visualizing workflows in DevUI, such as not requiring the use of
WithName to match the DI registration name or calling AddAsAIAgent.
- Provide alternative ways to register workflows and agents that can be visualized in DevUI without strict dependency injection requirements.
- Improved documentation on how to set up workflows and agents with all the requirements and limitations for DevUI visualization.
Limitation Details
Workflows must be registered using the agents usingAddAsAIAgentto be visualized and funcational.WithName(providenameparam for agentic workflow), which must match the workflow name in the dependency injection registration.ChatProtocolExecutoror needs to support getting bothList<ChatMessage>andTurnTokenas input. See the sample below:Expectation
WithNameto match the DI registration name orcallingAddAsAIAgent.