microsoft/autogen · error · NotImplementedException

The method or operation is not implemented.

Error message

The method or operation is not implemented.

What it means

ProcessMessageForSelf converts messages authored by the agent itself into SK ChatMessageContent. It handles TextMessage, MultiModalMessage, and the deprecated Message type; anything else — ImageMessage, ToolCallMessage, ToolCallResultMessage, AggregateMessage, custom types — falls through to NotImplementedException.

Source

Thrown at dotnet/src/AutoGen.SemanticKernel/Middleware/SemanticKernelChatMessageContentConnector.cs:139

                return ProcessMessageForSelf(m);
            }
            else
            {
                return ProcessMessageForOthers(m);
            }
        });
    }

    private IEnumerable<ChatMessageContent> ProcessMessageForSelf(IMessage message)
    {
        return message switch
        {
            TextMessage textMessage => ProcessMessageForSelf(textMessage),
            MultiModalMessage multiModalMessage => ProcessMessageForSelf(multiModalMessage),
#pragma warning disable CS0618 // deprecated
            Message m => ProcessMessageForSelf(m),
#pragma warning restore CS0618 // deprecated
            _ => throw new System.NotImplementedException(),
        };
    }

    private IEnumerable<ChatMessageContent> ProcessMessageForOthers(IMessage message)
    {
        return message switch
        {
            TextMessage textMessage => ProcessMessageForOthers(textMessage),
            MultiModalMessage multiModalMessage => ProcessMessageForOthers(multiModalMessage),
            ImageMessage imageMessage => ProcessMessageForOthers(imageMessage),
#pragma warning disable CS0618 // deprecated
            Message m => ProcessMessageForOthers(m),
#pragma warning restore CS0618 // deprecated
            _ => throw new InvalidOperationException("unsupported message type, only support TextMessage, ImageMessage, MultiModalMessage and Message."),
        };
    }

    private IEnumerable<ChatMessageContent> ProcessMessageForSelf(TextMessage message)

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Filter history to TextMessage/MultiModalMessage (from self) before sending to the SK agent.
  2. Serialize unsupported self-authored messages into a TextMessage summary before replay.
  3. Handle ToolCallMessage/AggregateMessage pairs with a dedicated tool-call connector instead of the plain chat content connector.
  4. Update AutoGen — newer connectors added arms for additional message kinds.

Example fix

// before
await skAgent.SendAsync(fullGroupChatHistory); // contains ToolCallMessage from self

// after
var safe = fullGroupChatHistory.Where(m => m is TextMessage or MultiModalMessage or Message);
await skAgent.SendAsync(safe);
Defensive patterns

Strategy: type-guard

Validate before calling

var skSafeSelf = history.Where(m => m is TextMessage or MultiModalMessage or Message).ToList();

Type guard

static bool IsSupportedSelfMessage(IMessage m) => m is TextMessage or MultiModalMessage or Message;

Try / catch

catch (NotImplementedException) when (processingSelfMessages)
{
    logger.LogError("Unsupported self-authored message type {Type} for SK agent", m.GetType().Name);
    throw;
}

Prevention

When it happens

Trigger: Replaying a conversation history to the same SK agent where the history contains a message type outside the three supported kinds, e.g. the agent's own ImageMessage or an AggregateMessage of tool calls.

Common situations: Group-chat histories replayed to SK agents; persisting and restoring conversations that include tool-call aggregates or images.

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/0df54b92634a3682. Report an issue: GitHub.