fix: preserve handoff agent attribution

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-21 20:32:22 +01:00
co-authored by Copilot
parent baea491cf2
commit d155085d0c
5 changed files with 173 additions and 12 deletions
@@ -95,6 +95,26 @@ public sealed class AgentIdentityResolverTests
Assert.Equal("Implementer", authorName);
}
[Fact]
public void TryResolveObservedAgentIdentity_UsesFallbackAgentForGenericAssistant()
{
PatternDefinitionDto pattern = CreatePattern(
[
CreateAgent(id: "agent-handoff-ux", name: "UX Specialist"),
CreateAgent(id: "agent-handoff-runtime", name: "Runtime Specialist"),
]);
bool resolved = AgentIdentityResolver.TryResolveObservedAgentIdentity(
pattern,
"assistant",
new AgentIdentity("agent-handoff-ux", "UX Specialist"),
out AgentIdentity agent);
Assert.True(resolved);
Assert.Equal("agent-handoff-ux", agent.AgentId);
Assert.Equal("UX Specialist", agent.AgentName);
}
private static PatternDefinitionDto CreatePattern(
IReadOnlyList<PatternAgentDefinitionDto> agents,
string mode = "concurrent")