- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.3k
Open
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codebugSomething isn't workingSomething isn't workingtriage
Description
Describe the bug
SequentialOrchestration.InvokeAsync() with AWS Bedrock agents completes successfully but result.GetValueAsync() returns an empty string, despite CloudWatch logs confirming the agent generated a response. The ResponseCallback is never invoked, indicating responses aren't being propagated through the orchestration pipeline. Lastly, only the first agent seems to be actually invoked.
To Reproduce
Steps to reproduce the behavior:
Here is a sample of the code I am trying to run following the examples provided in this file and also in this article:
public async Task SequentialOrchestrationTest() {
    var builder = Kernel.CreateBuilder();
    var kernel = builder.Build();
    // retrieve credentials
    var profile = new CredentialProfileStoreChain();
    profile.TryGetAWSCredentials("my-profile", out var credentials);
    var clientRuntime = new AmazonBedrockAgentRuntimeClient(credentials, RegionEndpoint.APSoutheast2);
    var client = new AmazonBedrockAgentClient(credentials, RegionEndpoint.APSoutheast2);
    // create first agent
    var analystRequest = new CreateAgentRequest {
        FoundationModel = "amazon.nova-micro-v1:0",
        Instruction = @"""""""
            You are a marketing analyst. Given a product description, identify:
            - Key features
            - Target audience
            - Unique selling points
            """"""",
        AgentName = "Analyst",
        AgentResourceRoleArn = "service-role",
        Description = "An agent that extracts key concepts from a product description."
    };
    var anaylistAgent = await client.CreateAgentAsync(analystRequest);
    await client.PrepareAgentAsync(new PrepareAgentRequest { AgentId = anaylistAgent.Agent.AgentId });
    var analystBedrockAgent = new BedrockAgent(anaylistAgent.Agent, client, clientRuntime) {
        Kernel = kernel
    };
    // first agent created and prepared
    // create second agent
    var copywriterRequest = new CreateAgentRequest {
        FoundationModel = "amazon.nova-micro-v1:0",
        Instruction = @"""""""
            You are a marketing copywriter. Given a block of text describing features, audience, and USPs,
            compose a compelling marketing copy (like a newsletter section) that highlights these points.
            Output should be short (around 150 words), output just the copy as a single text block.
            """"""",
        AgentName = "copywriter",
        AgentResourceRoleArn = "service-role",
        Description = "An agent that extracts key concepts from a product description."
    };
    var copywriterAgent = await client.CreateAgentAsync(copywriterRequest);
    await client.PrepareAgentAsync(new PrepareAgentRequest { AgentId = copywriterAgent.Agent.AgentId });
    var copywriterBedrockAgent = new BedrockAgent(copywriterAgent.Agent, client, clientRuntime) {
        Kernel = kernel
    };
    // second agent created and prepared
    ValueTask AgentResponseCallBack(Microsoft.SemanticKernel.ChatMessageContent content) {
        // this is never called
        Console.WriteLine(content);
        return new ValueTask();
    }
    ILoggerFactory loggerFactory = LoggerFactory.Create(l => l.AddDebug().AddConsole().SetMinimumLevel(LogLevel.Debug));
    var orchestration = new SequentialOrchestration(analystBedrockAgent, copywriterBedrockAgent) {
        Description = "Sequential orchestration.",
        ResponseCallback = AgentResponseCallBack,
        LoggerFactory = loggerFactory
    };
    var runtime = new InProcessRuntime();
    await runtime.StartAsync();
    var orchestrationResult = await orchestration.InvokeAsync("Invent a new holiday and explain how people celebrate it.", runtime);
    var value = await orchestrationResult.GetValueAsync(TimeSpan.FromSeconds(25000));
    await runtime.RunUntilIdleAsync();
}
Expected behavior
- ResponseCallbackshould be invoked with agent's response
- result.GetValueAsync()should return the agent's response text
Actual behavior
- ResponseCallbackis never invoked
- result.GetValueAsync()returns empty string ""
- AWS CloudWatch confirms agent successfully generated response with 224 output tokens
Platform
- Language: C# / .NET Framework 4.8
- Source: NuGet packages:
- Amazon.BedrockAgent;
- Amazon.BedrockAgent.Model;
- Amazon.BedrockAgentRuntime;
- Amazon.BedrockRuntime;
- Amazon.Runtime;
- Microsoft.SemanticKernel;
- Microsoft.SemanticKernel.Agents;
- Microsoft.SemanticKernel.Agents.Bedrock;
- Microsoft.SemanticKernel.Agents.Orchestration;
- Microsoft.SemanticKernel.Agents.Orchestration.Sequential;
- Microsoft.SemanticKernel.Agents.Runtime.InProcess;
 
- AI model: "amazon.nova-micro-v1:0"
- IDE: Visual Studio 2026
- OS: Windows
Additional context
Here is the logs printed in the console while trying to debug the problem
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialOrchestration: Information: REGISTER ACTOR SequentialOrchestration MEMBER #2: SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_2
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialOrchestration: Information: REGISTER ACTOR SequentialOrchestration MEMBER #1: SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_1
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialOrchestration: Information: INVOKE SequentialOrchestration: SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82/default
Microsoft.SemanticKernel.Agents.Orchestration.AgentOrchestration.RequestActor: Information: INIT SequentialOrchestration: SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Boot/default
Microsoft.SemanticKernel.Agents.Orchestration.AgentOrchestration.RequestActor: Information: START SequentialOrchestration: SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Boot/default
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialActor: Information: ACTOR SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_1/default SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_2
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialActor: Information: INVOKE SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_1/default SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_2
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialActor: Information: ACTOR SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_2/default SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Root
Microsoft.SemanticKernel.Agents.Orchestration.Sequential.SequentialActor: Information: INVOKE SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Agent_2/default SequentialOrchestration_c082a2b29a5a44c3afbd4d84b6324a82_Root
The thread 20076 has exited with code 0 (0x0).
The thread 31080 has exited with code 0 (0x0).
The thread 9008 has exited with code 0 (0x0).
The thread 51392 has exited with code 0 (0x0).
The thread 4828 has exited with code 0 (0x0).
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codebugSomething isn't workingSomething isn't workingtriage