{"record":{"id":"ee656a8332104429","repo":"microsoft/semantic-kernel","slug":"entry-agent-is-not-defined-ee656a","errorCode":null,"errorMessage":"Entry agent is not defined.","messagePattern":"Entry agent is not defined\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Agents/Orchestration/GroupChat/GroupChatOrchestration.cs","lineNumber":40,"sourceCode":"    /// <summary>\n    /// Initializes a new instance of the <see cref=\"GroupChatOrchestration{TInput, TOutput}\"/> class.\n    /// </summary>\n    /// <param name=\"manager\">The manages the flow of the group-chat.</param>\n    /// <param name=\"agents\">The agents participating in the orchestration.</param>\n    public GroupChatOrchestration(GroupChatManager manager, params Agent[] agents)\n        : base(agents)\n    {\n        Verify.NotNull(manager, nameof(manager));\n\n        this._manager = manager;\n    }\n\n    /// <inheritdoc />\n    protected override ValueTask StartAsync(IAgentRuntime runtime, TopicId topic, IEnumerable<ChatMessageContent> input, AgentType? entryAgent)\n    {\n        if (!entryAgent.HasValue)\n        {\n            throw new ArgumentException(\"Entry agent is not defined.\", nameof(entryAgent));\n        }\n        return runtime.PublishMessageAsync(input.AsInputTaskMessage(), entryAgent.Value);\n    }\n\n    /// <inheritdoc />\n    protected override async ValueTask<AgentType?> RegisterOrchestrationAsync(IAgentRuntime runtime, OrchestrationContext context, RegistrationContext registrar, ILogger logger)\n    {\n        AgentType outputType = await registrar.RegisterResultTypeAsync<GroupChatMessages.Result>(response => [response.Message]).ConfigureAwait(false);\n\n        int agentCount = 0;\n        GroupChatTeam team = [];\n        foreach (Agent agent in this.Members)\n        {\n            ++agentCount;\n            AgentType agentType = await RegisterAgentAsync(agent, agentCount).ConfigureAwait(false);\n            string name = agent.Name ?? agent.Id ?? agentType;\n            string? description = agent.Description;\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Agents/Orchestration/GroupChat/GroupChatOrchestration.cs#L22-L58","documentation":"Thrown by GroupChatOrchestration.StartAsync when entryAgent.HasValue is false. GroupChat requires a designated entry agent to receive the first input task message; the framework passes entryAgent from the invoke call, and if none is supplied the orchestration cannot route the initial message and fails fast.","triggerScenarios":"Invoking a GroupChatOrchestration without specifying the entry agent (the orchestration invoke overload that leaves entryAgent null).","commonSituations":"Calling the orchestration's invoke without chaining .WithEntryAgent(...) / without the entry-agent parameter; misconfigured orchestration builder.","solutions":["Specify the entry agent when invoking the group chat.","Use the orchestration API that lets you declare the entry agent, and make sure one of the registered members is chosen."],"exampleFix":"// before\norchestration.InvokeAsync(input); // entryAgent null -> throws\n\n// after — declare the entry agent member\norchestration.InvokeAsync(input, entryAgent: agentType);","handlingStrategy":"validation","validationCode":"// Always pass the entry agent type when invoking a group chat\nawait groupChatOrchestration.InvokeAsync(input, entryAgent: entryAgentType);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify the entry agent when invoking GroupChatOrchestration.","Ensure the entry agent is one of the registered members.","Unit-test the invoke path so a missing entry agent fails loudly in tests."],"tags":["orchestration","groupchat","configuration","agents","validation"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}