Skip to content

.NET: [Workflows] Handoff tool response appears in chat history, causing inconsistent LLM behavior #3046

@svehera

Description

@svehera

Description

I am using an Agent handoff workflow with three agents:

  • 1 orchestrator agent
  • 2 worker agents

The orchestrator correctly routes user requests to a worker using a handoff_to_X tool call.

The handoff tool response ("Transferred.") always appears in the replayed chat history when the worker agent starts processing.

However, in roughly 25% of executions, the LLM interprets this response incorrectly, which leads to inconsistent behavior.

Instead of processing the original user request, the worker responds as if it is also performing a transfer, for example:

“I am transferring this request to ensure you receive a detailed analysis…”

This results in an incorrect final response.


Expected Behavior

After a handoff:

  • The worker agent processes the original user request
  • The handoff tool response does not influence reasoning
  • The worker does not produce meta-responses about transferring

Actual Behavior

  • The handoff tool response ("Transferred.") is always included
  • In ~25% of runs, the LLM interprets this message as an instruction
  • The worker outputs a transfer-style response instead of executing the task

Example

Original user message

Show me cases by severity level in my unit

Observed worker response (incorrect)

You requested cases broken down by severity level in your unit. I am transferring this request to ensure you receive a detailed analysis…

(See screenshots below.)


Suspected Cause

The handoff tool response text ("Transferred.") is included in the conversational context passed to the worker.

While this message is intended as an internal control signal, the LLM sometimes interprets it as a conversational cue, leading the worker to believe it must initiate another transfer rather than execute the request.


Proposed Improvements

One of the following would likely resolve the issue:

  1. Change the default Handoff tool response wording

    • From: "Transferred."
    • To something less conversational, for example:
      • "Accepted. Processing started."
      • "Handoff completed. Executing request."
  2. Allow custom or suppressed handoff responses

    • Allow developers to customize the tool response text
    • Or provide an option to suppress the response from the replayed history entirely
    • This would prevent the message from affecting downstream reasoning

Notes

  • The "Transferred." message is always present
  • The issue lies in non-deterministic LLM interpretation, not tool execution
  • The orchestrator behavior is correct and consistent
  • The inconsistency appears only in the worker agent’s reasoning

Screenshots

Original user message :
Image

Incorrect worker response after handoff:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions