mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-08 12:48:48 +02:00
refactor: decouple turn execution state from Copilot SDK events
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Aryx.AgentHost.Contracts;
|
||||
using Aryx.AgentHost.Services;
|
||||
using GitHub.Copilot.SDK;
|
||||
|
||||
namespace Aryx.AgentHost.Tests;
|
||||
|
||||
internal static class SessionEventTestExtensions
|
||||
{
|
||||
private static readonly IProviderEventAdapter ProviderEventAdapter = new CopilotEventAdapter();
|
||||
|
||||
public static void ObserveSessionEvent(
|
||||
this CopilotTurnExecutionState state,
|
||||
WorkflowNodeDto agentDefinition,
|
||||
SessionEvent sessionEvent)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(state);
|
||||
ArgumentNullException.ThrowIfNull(agentDefinition);
|
||||
ArgumentNullException.ThrowIfNull(sessionEvent);
|
||||
|
||||
ProviderSessionEvent providerEvent = Assert.IsAssignableFrom<ProviderSessionEvent>(
|
||||
ProviderEventAdapter.TryAdapt(sessionEvent));
|
||||
|
||||
state.ObserveSessionEvent(agentDefinition, providerEvent);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user