Add PlanSignoff_Disabled_Proceeds_Immediately E2E test

Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/6e8bca46-448d-4f21-a7e9-240179571970

Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-13 22:00:48 +00:00
committed by GitHub
Unverified
parent 8a6a5948ed
commit c0bd2a33eb
@@ -220,6 +220,45 @@ public class MagenticOrchestrationTests
ledgerEvent.ProgressLedger.IsRequestSatisfied.Should().BeTrue(); ledgerEvent.ProgressLedger.IsRequestSatisfied.Should().BeTrue();
} }
[Fact]
public async Task PlanSignoff_Disabled_Proceeds_Immediately()
{
// Arrange: requirePlanSignoff=false should mean no plan review request
List<ChatMessage> factsResponse = CreatePlanResponse("Task facts");
List<ChatMessage> planResponse = CreatePlanResponse("Step 1: Execute immediately");
List<ChatMessage> progressLedgerResponse = CreateProgressLedgerResponse(
isRequestSatisfied: true,
isInLoop: false,
isProgressBeingMade: true,
nextSpeaker: "Worker",
instructionOrQuestion: "Go");
List<ChatMessage> finalAnswerResponse = CreateFinalAnswerResponse("Immediate completion");
TestReplayAgent manager = new(
[factsResponse, planResponse, progressLedgerResponse, finalAnswerResponse],
name: "Manager");
TestEchoAgent worker = new(name: "Worker");
List<WorkflowEvent> collectedEvents = [];
Workflow workflow = new MagenticWorkflowBuilder(manager)
.AddParticipants(worker)
.RequirePlanSignoff(false)
.Build();
// Act
WorkflowRunResult runResult = await RunMagenticWorkflowAsync(
workflow,
[new ChatMessage(ChatRole.User, "Do it now")],
eventCollector: collectedEvents);
// Assert: No plan review request, workflow completes immediately
runResult.PendingRequests.Should().BeEmpty("plan signoff is disabled, so no review should be requested");
collectedEvents.OfType<RequestInfoEvent>().Should().BeEmpty();
runResult.Result.Should().NotBeNull();
runResult.Result![0].Text.Should().Contain("Immediate completion");
}
#region Helper Methods #region Helper Methods
private sealed record WorkflowRunResult( private sealed record WorkflowRunResult(