-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Copy link
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeagentsbugSomething isn't workingSomething isn't workingmulti-agentIssues for multi-agent orchestrationIssues for multi-agent orchestration
Description
Describe the bug
When calling SequentialOrchestration with invalid parameters, GetResultAsync() hangs indefinetly.
To Reproduce
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents.Orchestration.Sequential;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.Runtime.InProcess;
var builder = Kernel.CreateBuilder();
// intentionally bad model/api key so that endpoint throws HTTP 401 (invalid_request_error: invalid_api_key)
builder.AddOpenAIChatCompletion(modelId: "foo", apiKey: "bar");
var kernel = builder.Build();
#pragma warning disable SKEXP0110
var agent = new ChatCompletionAgent { Kernel = kernel, Instructions = "You are helpful assistant.", Description = "Test agent" };
var orchestration = new SequentialOrchestration(agent);
var runtime = new InProcessRuntime();
try
{
await runtime.StartAsync();
var result = await orchestration.InvokeAsync("Hi", runtime);
// hangs here, never returns, no exceptions
await result.GetValueAsync();
}
catch (Exception ex)
{
// never called
Console.WriteLine(ex);
}
await runtime.RunUntilIdleAsync();Expected behavior
Exception from agent invoke is propagated somewhere.
Platform
- Language: C#
- Source:
Microsoft.SemanticKernel.Agents.Core Version=1.64.0
Microsoft.SemanticKernel.Agents.OpenAI Version=1.64.0-preview
Microsoft.SemanticKernel.Agents.Orchestration Version=1.64.0-preview
Microsoft.SemanticKernel.Agents.Runtime.InProcess Version=1.64.0-preview
- AI model: none
- IDE: Visual Studio
- OS: Windows
Additional context
Exception
System.ClientModel.ClientResultException: 'HTTP 401 (invalid_request_error: invalid_api_key)
Incorrect API key provided: bar. You can find your API key at https://platform.openai.com/account/api-keys.'
Can be caught under debugger, it occurs right away, but is swallowed silently.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeagentsbugSomething isn't workingSomething isn't workingmulti-agentIssues for multi-agent orchestrationIssues for multi-agent orchestration
Type
Projects
Status
Bug
Status
Done