{"record":{"id":"5ae88e0e54ca2f88","repo":"microsoft/semantic-kernel","slug":"openairesponseagent-is-not-for-use-with-agentchat","errorCode":null,"errorMessage":"OpenAIResponseAgent is not for use with AgentChat.","messagePattern":"OpenAIResponseAgent is not for use with AgentChat\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs","lineNumber":134,"sourceCode":"            for (; messageIndex < chatHistory.Count; messageIndex++)\n            {\n                ChatMessageContent newMessage = chatHistory[messageIndex];\n                await this.NotifyThreadOfNewMessage(agentThread, newMessage, cancellationToken).ConfigureAwait(false);\n\n                if (options?.OnIntermediateMessage is not null)\n                {\n                    await options.OnIntermediateMessage(newMessage).ConfigureAwait(false);\n                }\n            }\n        }\n    }\n\n    /// <inheritdoc/>\n    [Experimental(\"SKEXP0110\")]\n    [ExcludeFromCodeCoverage]\n    protected override Task<AgentChannel> CreateChannelAsync(CancellationToken cancellationToken)\n    {\n        throw new NotSupportedException($\"{nameof(OpenAIResponseAgent)} is not for use with {nameof(AgentChat)}.\");\n    }\n\n    /// <inheritdoc/>\n    [Experimental(\"SKEXP0110\")]\n    [ExcludeFromCodeCoverage]\n    protected override IEnumerable<string> GetChannelKeys()\n    {\n        throw new NotSupportedException($\"{nameof(OpenAIResponseAgent)} is not for use with {nameof(AgentChat)}.\");\n    }\n\n    /// <inheritdoc/>\n    [Experimental(\"SKEXP0110\")]\n    [ExcludeFromCodeCoverage]\n    protected override Task<AgentChannel> RestoreChannelAsync(string channelState, CancellationToken cancellationToken)\n    {\n        throw new NotSupportedException($\"{nameof(OpenAIResponseAgent)} is not for use with {nameof(AgentChat)}.\");\n    }\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs#L116-L152","documentation":"OpenAIResponseAgent targets the OpenAI Responses API and deliberately does not participate in the AgentChat (multi-agent conversation) framework. Its CreateChannelAsync override throws NotSupportedException so that AgentChat cannot instantiate a channel for it. The framework calls CreateChannelAsync when it needs to activate an agent's channel; rejecting it here prevents misuse.","triggerScenarios":"Adding an OpenAIResponseAgent to an AgentChat / AgentGroupChat, or otherwise triggering channel creation through the AgentChat pipeline.","commonSituations":"Migrating code from OpenAIAssistantAgent (which supports AgentChat) to OpenAIResponseAgent and reusing the existing AgentChat wiring; mixing a Responses-API agent into a group chat.","solutions":["Do not put OpenAIResponseAgent in an AgentChat. Invoke it directly: await responseAgent.InvokeAsync(messages, thread).","For multi-agent group-chat scenarios, use OpenAIAssistantAgent (Assistants API) instead.","If you need multiple Response agents, orchestrate them manually or via the Agents Orchestration layer, not AgentChat."],"exampleFix":"// before (throws NotSupportedException)\nvar chat = new AgentGroupChat(responseAgent);\nawait chat.InvokeAsync();\n\n// after — invoke the Response agent directly\nvar result = await responseAgent.InvokeAsync(messages, responseThread);","handlingStrategy":"validation","validationCode":"// Never add a Response agent to AgentChat; invoke it directly instead\nawait responseAgent.InvokeAsync(messages, responseThread);","typeGuard":"static bool IsAgentChatCompatible(Agent agent) => agent is not OpenAIResponseAgent;","tryCatchPattern":null,"preventionTips":["Reserve OpenAIResponseAgent for direct InvokeAsync usage.","Use OpenAIAssistantAgent when you need AgentChat group conversations.","Review agent types before adding to an AgentChat."],"tags":["agents","agentchat","responses-api","notsupported","configuration"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}