Skip to content

Conversation

Laurianti
Copy link

Motivation and Context

  1. Why is this change required?
    Because LocalAgentStep was passing KernelProcessEventData wrappers directly into KernelArguments, unlike LocalStep which unwraps them. This inconsistency caused agents to receive JSON-like data instead of the actual payload.

  2. What problem does it solve?
    It ensures that agents receive the real value (e.g. the user’s message text) instead of the wrapper object, preventing confusing model responses like “you seem to be passing a json”.

  3. What scenario does it contribute to?
    Agent-based process pipelines (for example a simple chat process where user input is sent to an agent). The agent now correctly sees the user input as plain text or object, improving reliability and user experience.

Description

This PR updates LocalAgentStep so that it unwraps KernelProcessEventData before passing it into KernelArguments["message"].

  • If TargetEventData is a KernelProcessEventData, we now call .ToObject() to get the real value.
  • If it is not, we keep the value as it is.
  • This makes LocalAgentStep consistent with LocalStep.AssignStepFunctionParameterValues.

With this change, agents no longer receive the wrapper object but the actual payload (for example the plain user input), which avoids the model interpreting it as JSON.

Contribution Checklist

@Laurianti Laurianti requested a review from a team as a code owner October 1, 2025 19:03
@moonbox3 moonbox3 added the .NET Issue or Pull requests regarding .NET code label Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants