Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

SendChatHistoryAsync in AgentFramework extension was short-circuiting on empty message lists, returning success without making the MCP platform call. Empty arrays must be passed through so the platform receives the call.

Changes

  • McpToolRegistrationService.cs: Removed early return for empty chatMessageArray. Empty arrays now flow through to _mcpServerConfigurationService.SendChatHistoryAsync().

  • IMcpToolRegistrationService.cs: Added <remarks> documenting that empty collections are passed through to the platform.

  • Tests: Updated 4 tests across 3 files to verify the underlying service is called with empty arrays (previously verified it was not called).

  • design.md: Added "Chat History and Empty Arrays" section explaining the behavior.

Before/After

// Before: empty list = no platform call
if (chatMessageArray.Length == 0)
{
    _logger.LogWarning("No chat messages provided");
    return OperationResult.Success;  // ❌ Platform never called
}

// After: empty list passed through
var chatHistoryMessages = chatMessageArray
    .Select(msg => new ChatHistoryMessage(...))
    .ToArray();  // ✅ Empty array sent to platform

Scope Check

Verified SemanticKernel and AzureAIFoundry extensions don't have this pattern—they already pass through correctly.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • il-000000000000000000000000000000.00.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenan.t1.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant1.23.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.appsplatform.us
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.gov.powerplatform.microsoft.us
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.high.powerplatform.microsoft.us
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.powerplatform.eaglex.ic.gov
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.powerplatform.microsoft.scloud
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.powerplatform.partner.microsoftonline.cn
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenantdiscoverynos.et.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenante.nv.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • il-tenantresolv.er.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)
  • override.example.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 38391 --endpoint 127.0.0.1:038391 --role client --parentprocessid 4509 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 35041 --endpoint 127.0.0.1:035041 --role client --parentprocessid 5711 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The implementation in this API is incorrect - we should not do nothing and return success if the list of messages is empty. We need to pass the empty list/array to the generic API so that the call to the MCP platform is still made. Please update this instance, look for other instances (a SendChatHistory* method where we check for an empty list/array), and update tests and documentation to ensure this behavior is tested and documented correctly.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 27, 2026 06:29
…of returning early

Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix API to handle empty message list correctly Fix SendChatHistoryAsync to pass empty message lists to MCP platform Jan 27, 2026
Copilot AI requested a review from pontemonti January 27, 2026 06:33
@pontemonti pontemonti marked this pull request as ready for review January 27, 2026 06:37
@pontemonti pontemonti requested a review from a team as a code owner January 27, 2026 06:37
Copilot AI review requested due to automatic review settings January 27, 2026 06:37
@pontemonti pontemonti enabled auto-merge (squash) January 27, 2026 06:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the AgentFramework extension's SendChatHistoryAsync method where empty message arrays were being short-circuited with an early return instead of being passed through to the MCP platform. The fix ensures empty arrays are always forwarded to the platform, allowing it to handle empty states according to its own logic.

Changes:

  • Removed early return logic that prevented empty message arrays from reaching the MCP platform
  • Updated XML documentation across 4 interface method overloads to clarify that empty collections are valid
  • Modified 4 unit tests to verify the underlying service is called with empty arrays (previously verified it was NOT called)
  • Added comprehensive documentation section explaining the rationale for passing empty arrays

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Tooling/Extensions/AgentFramework/Services/McpToolRegistrationService.cs Removed early return for empty arrays; added comment clarifying empty arrays are sent to MCP platform
src/Tooling/Extensions/AgentFramework/Services/IMcpToolRegistrationService.cs Updated XML documentation for all 4 SendChatHistoryAsync overloads to document empty array behavior
src/Tooling/Extensions/AgentFramework/docs/design.md Added "Chat History and Empty Arrays" section explaining why empty arrays must be passed through
src/Tests/.../SendChatHistoryAsync_IEnumerable_Tests.cs Updated test to verify service is called with empty arrays instead of verifying it's NOT called
src/Tests/.../SendChatHistoryAsync_IEnumerable_WithToolOptions_Tests.cs Updated test to verify service is called with empty arrays and proper ToolOptions
src/Tests/.../SendChatHistoryAsync_ChatMessageStore_Tests.cs Updated 2 tests to verify service is called with empty arrays for both overloads

@pontemonti pontemonti merged commit 8729945 into main Jan 27, 2026
11 checks passed
@pontemonti pontemonti deleted the copilot/fix-empty-message-api-call branch January 27, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants