fix: strengthen group chat collaboration guidance

Audit confirmed that single, sequential, concurrent, and handoff are mapped to distinct workflow builders as intended. Group-chat was also using the correct round-robin manager, but the agents only had one-shot role prompts, so the reviewer could behave like a fresh assistant instead of refining the draft in progress. Add explicit runtime guidance for group-chat participants plus clearer built-in Writer/Reviewer instructions and regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-23 23:22:09 +01:00
co-authored by Copilot
parent cf699b2442
commit 794722673b
4 changed files with 62 additions and 2 deletions
@@ -20,6 +20,25 @@ internal static class AgentInstructionComposer
"""
: string.Empty;
if (string.Equals(pattern.Mode, "group-chat", StringComparison.OrdinalIgnoreCase))
{
string groupChatGuidance = agentIndex == 0
? """
You are participating in a collaborative multi-turn group chat under a round-robin manager.
On your first turn, produce the initial draft for the user.
On later turns, refine your earlier draft based on the other agents' feedback instead of restarting from scratch.
Do not greet the user again or reset the conversation once work is underway.
"""
: """
You are participating in a collaborative multi-turn group chat under a round-robin manager.
Build on the latest draft from the other agents and contribute specific critique or improvements.
Do not restart the conversation, greet the user again, or answer as though no draft exists yet.
Focus on refining the answer already in progress.
""";
return JoinInstructionBlocks(baseInstructions, workspaceGuidance, groupChatGuidance);
}
if (!string.Equals(pattern.Mode, "handoff", StringComparison.OrdinalIgnoreCase))
{
return JoinInstructionBlocks(baseInstructions, workspaceGuidance);