Python: [Bug]: SequentialBuilder second agent receives assistant-ending history and some models return empty text
@eavanvalkenburg is already working on this.
Since Sep 10, 2026.
Assessment
This issue has not been assessed yet.
Description
Description
When using SequentialBuilder with multiple agent participants (default settings), the second (and later) participant is invoked with the prior agent's full_conversation.
Observed shape for a two-agent sequential run:
[user, assistant(writer output)]
That matches the documented chaining behavior (AgentExecutor.from_response with default context_mode="full" → prior.full_conversation).
With at least one OpenAI-compatible chat model we tested (qwen3.8-27b@4bit behind a chat-completions API), a completion whose input ends with an assistant message returns essentially empty text:
finish_reason=stopcontentsempty (or only a usage chunk)usage.output_token_count≈ 1
So the second participant (e.g. “reviewer”) appears to “run successfully”, but produces no assistant text. Downstream AG-UI workflow streaming then has no TEXT_MESSAGE_* events for that turn (only an empty AgentResponseUpdate surfaced as a custom/workflow_output-style payload).
Expected: We are looking for guidance from maintainers on how Sequential / multi-agent conversation chaining is intended to work with providers that do not emit text when the prompt ends on assistant.
Repro outline
- Build
SequentialBuilder(participants=[writer, reviewer]).build()with two chat agents on the model above. - Run with a simple user prompt (streaming or non-streaming).
- Writer returns normal assistant text.
- Reviewer is called with
[user, assistant(writer)]and returns empty assistant content.
Same empty result when calling the second agent directly:
agent.run([
Message(role="user", contents=["go"]),
Message(role="assistant", contents=["W-OK"]),
], stream=True)
# → stop with empty text
While:
agent.run([Message(role="user", contents=["go"])], stream=True)
# → normal text
and
agent.run([
Message(role="user", contents=["go"]),
Message(role="assistant", contents=["W-OK"]),
Message(role="user", contents=["continue"]),
], stream=True)
# → normal text
No exception is raised; the workflow completes with executor_completed / RUN_FINISHED.
Code Sample
from agent_framework.orchestrations import SequentialBuilder
workflow = SequentialBuilder(participants=[writer, reviewer]).build()
# stream=True or stream=False both show the same empty second-agent text
async for event in workflow.run("go", stream=True):
...
# reviewer AgentResponse / AgentResponseUpdate has empty text contents
Error Messages / Stack Traces
No exception. Empty model completion only.
Example observed update for the second agent:
AgentResponseUpdate(contents=[], role=assistant, finish_reason=stop, ...)
# followed by a usage-only update
Package Versions
agent-framework (core): 1.15.0
agent-framework-orchestrations: 1.1.1
agent-framework-ag-ui: (used when observing AG-UI TEXT_MESSAGE absence; core issue reproduces without AG-UI via workflow.run / agent.run)
Python Version
Python 3.14
Additional Context
- Default Sequential settings (
chain_only_agent_responses=False). Withchain_only_agent_responses=True, the second agent still receives an assistant-ending message list ([assistant(writer)]), and we observed the same empty completion pattern. - First participant is fine; only subsequent participants that inherit assistant-ending history are affected on this model.
- Happy to provide more traces (executor_invoked payloads / raw chat-completions request bodies) if useful.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 362
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/agent-framework
-
python triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/agent-framework#8599 · 1 comment ·
-
python
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/agent-framework#8590 ·
-
python triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/agent-framework#8523 · 1 comment ·
-
.NET compaction documentation
Difficulty 1/5 Under an hour Newbie friendliness 82/100
microsoft/agent-framework#4629 · 1 comment ·
-
.NET harness python reproduced
microsoft/agent-framework#8620 · 1 comment · 1 assignee ·
All issues in microsoft/agent-framework
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100