Skip to content

Commit 882ea4d

Browse files
jpalvarezlCopilot
andcommitted
Merge upstream main into PowerFx preprocessing fix
Co-authored-by: Copilot <[email protected]>
2 parents 2f8148c + bf4d8dc commit 882ea4d

115 files changed

Lines changed: 10808 additions & 791 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/decisions/0003-agent-opentelemetry-instrumentation.md‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,43 @@ The implementation is validated through:
124124

125125
### Usage Example
126126

127+
The name passed to `TracerProviderBuilder.AddSource` must match the source name the agent emits under, otherwise the
128+
provider silently receives no agent spans. When no source name is supplied to `UseOpenTelemetry`, the agent emits under
129+
`OpenTelemetryAgent.DefaultSourceName`, so that is the value to register. That property is marked
130+
`[Experimental("MAAI001")]`; suppress that diagnostic in your csproj to use it.
131+
127132
```csharp
128133
// Create TracerProvider
129134
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
130-
.AddSource(AgentOpenTelemetryConsts.DefaultSourceName)
135+
.AddSource(OpenTelemetryAgent.DefaultSourceName)
131136
.AddConsoleExporter()
132137
.Build();
133138

134139
// Create and wrap agent with telemetry
135140
var baseAgent = new ChatClientAgent(chatClient, options);
136-
using var telemetryAgent = baseAgent.WithOpenTelemetry();
141+
using var telemetryAgent = baseAgent.AsBuilder()
142+
.UseOpenTelemetry()
143+
.Build();
137144

138145
// Use agent normally - telemetry is captured automatically
139146
var response = await telemetryAgent.RunAsync(messages);
140147
```
141148

149+
To emit under a custom source name, pass the same value to both calls:
150+
151+
```csharp
152+
const string SourceName = "MyCompany.MyAgent";
153+
154+
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
155+
.AddSource(SourceName)
156+
.AddConsoleExporter()
157+
.Build();
158+
159+
using var telemetryAgent = baseAgent.AsBuilder()
160+
.UseOpenTelemetry(sourceName: SourceName)
161+
.Build();
162+
```
163+
142164
### Relationship to Microsoft.Extensions.AI
143165

144166
This implementation follows the exact patterns established by Microsoft.Extensions.AI's OpenTelemetry instrumentation, ensuring consistency across the AI ecosystem and leveraging proven patterns for telemetry integration.

‎docs/specs/004-python-function-calling-loop.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ that manually replay messages own the equivalent rule: do not resend an approval
392392
Changing arguments after security middleware has processed them fails closed with `MiddlewareFailure`.
393393
- Argument-validation failures after middleware retain the established `Argument parsing failed` result contract.
394394
Exceptions raised by middleware or the tool body retain the separate `Function failed` contract.
395+
- Provider-hosted shell calls remain informational transcript content. Only a well-formed explicit `local_shell_call`
396+
or a shell call marked with a local environment, paired with a configured local executor, can enter the local
397+
function loop and its approval boundary. Stateless replay preserves provider shell call/output items in their
398+
original shape and fails explicitly when that provider representation is unavailable or inconsistent. Locally
399+
generated shell outputs are sent in both service-side and stateless continuation modes.
395400

396401
### Reasoning-bound calls
397402

@@ -514,6 +519,7 @@ that manually replay messages own the equivalent rule: do not resend an approval
514519
| Calls across response messages | Every actionable call is executed once. | `test_base_client_executes_function_calls_across_multiple_response_messages` |
515520
| Parallel calls | Results retain the corresponding call ids and execution count. | `test_max_function_calls_limits_parallel_invocations`, `test_streaming_multiple_function_calls_parallel_execution` |
516521
| Informational-only call | The call is returned but not executed or approved. | `test_informational_only_function_call_is_not_invoked`, `test_informational_only_function_call_does_not_request_approval`, `test_streaming_informational_only_function_call_is_not_invoked` |
522+
| OpenAI hosted/local shell boundary | Hosted shell calls remain informational in streaming and non-streaming responses even when a local executor is configured; only valid explicit local-shell items or shell calls marked with a local environment can execute, local execution preserves its configured approval mode, stateless loops preserve the complete provider shell transcript or fail explicitly, and locally generated shell outputs are sent in every continuation mode. | `packages/openai/tests/openai/test_openai_chat_client.py::test_response_content_creation_with_shell_call_remains_hosted_with_local_tool`, `test_parse_chunk_from_openai_shell_call_done_remains_hosted`, `test_parse_chunk_from_openai_local_environment_shell_call_done_emits_command`, `test_mixed_shell_calls_only_invoke_explicit_local_shell_call`, `test_stateless_shell_transcript_without_provider_item_fails`, `test_prepare_messages_keeps_local_shell_output_under_storage`, `test_malformed_local_environment_shell_call_is_not_executable`, `test_response_content_creation_with_local_shell_call_maps_to_function_call`, `test_malformed_local_shell_call_is_not_executable`, `test_response_function_call_named_local_shell_is_informational`, `test_parse_chunk_function_call_named_local_shell_is_informational`, `test_local_shell_tool_requires_approval_before_function_loop_execution` |
517523
| Declaration-only call | The call is surfaced as user input and is not executed; streaming arguments appear once while finalized request metadata remains available. | `test_declaration_only_tool`, `test_streaming_declaration_only_tool_preserves_metadata_without_duplicate_arguments` |
518524
| Function invocation disabled | The client bypasses the invocation loop without losing invocation kwargs. | `test_function_invocation_config_enabled_false`, `test_function_invocation_config_enabled_false_preserves_invocation_kwargs`, `test_streaming_function_invocation_config_enabled_false` |
519525
| Runtime tool changes | Added tools become available on the next iteration and retain approval behavior. | `test_add_tools_available_next_iteration`, `test_add_tools_with_approval_required_tool` |

‎dotnet/Directory.Packages.props‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<PackageVersion Include="Aspire.Azure.AI.OpenAI" Version="13.5.3-preview.1.26425.3" />
1818
<PackageVersion Include="Aspire.Azure.AI.Inference" Version="13.5.3-preview.1.26425.3" />
1919
<PackageVersion Include="Aspire.Hosting.Azure.AIFoundry" Version="13.1.3-preview.1.26166.8" />
20+
<PackageVersion Include="Aspire.Hosting.Azure" Version="$(AspireAppHostSdkVersion)" />
2021
<PackageVersion Include="Aspire.Hosting.AppHost" Version="$(AspireAppHostSdkVersion)" />
2122
<PackageVersion Include="Aspire.Hosting.Azure.CognitiveServices" Version="$(AspireAppHostSdkVersion)" />
2223
<PackageVersion Include="Aspire.Microsoft.Azure.Cosmos" Version="$(AspireAppHostSdkVersion)" />

‎dotnet/samples/05-end-to-end/DevUIAspireIntegration/DevUIIntegration.AppHost/DevUIIntegration.AppHost.csproj‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
7-
<TargetFrameworks>net10.0</TargetFrameworks>
7+
<TargetFramework>net10.0</TargetFramework>
8+
<TargetFrameworks />
89
<ImplicitUsings>enable</ImplicitUsings>
910
<Nullable>enable</Nullable>
1011
</PropertyGroup>
@@ -18,6 +19,7 @@
1819

1920
<ItemGroup>
2021
<PackageReference Include="Aspire.Hosting.Azure.AIFoundry" />
22+
<PackageReference Include="Aspire.Hosting.Azure" />
2123
<PackageReference Include="OpenAI" />
2224
<ProjectReference Include="..\..\..\..\src\Microsoft.Agents.AI.OpenAI\Microsoft.Agents.AI.OpenAI.csproj" IsAspireProjectResource="false" />
2325
<ProjectReference Include="..\..\..\..\src\Microsoft.Agents.AI.DevUI\Microsoft.Agents.AI.DevUI.csproj" IsAspireProjectResource="false" />

‎dotnet/samples/05-end-to-end/DevUIAspireIntegration/DevUIIntegration.AppHost/Properties/launchSettings.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"DOTNET_ENVIRONMENT": "Development",
1212
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:17250",
1313
"ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:18100",
14-
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:17250",
14+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:17252",
1515
"ASPIRE_SHOW_DASHBOARD_RESOURCES": "true"
1616
}
1717
},
@@ -25,7 +25,7 @@
2525
"DOTNET_ENVIRONMENT": "Development",
2626
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:17251",
2727
"ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18101",
28-
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:17251",
28+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:17253",
2929
"ASPIRE_SHOW_DASHBOARD_RESOURCES": "true",
3030
"ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true"
3131
}

‎dotnet/src/Aspire.Hosting.AgentFramework.DevUI/AgentFrameworkBuilderExtensions.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Threading;
77
using Aspire.Hosting.AgentFramework;
88
using Aspire.Hosting.ApplicationModel;
9+
using Microsoft.Extensions.Configuration;
910
using Microsoft.Extensions.DependencyInjection;
1011
using Microsoft.Extensions.Hosting;
1112
using Microsoft.Extensions.Logging;
@@ -63,7 +64,10 @@ public static IResourceBuilder<DevUIResource> AddDevUI(
6364
builder.Eventing.Subscribe<InitializeResourceEvent>(resource, async (e, ct) =>
6465
{
6566
var logger = e.Logger;
66-
var aggregator = new DevUIAggregatorHostedService(resource, e.Services.GetRequiredService<ILoggerFactory>().CreateLogger<DevUIAggregatorHostedService>());
67+
var aggregator = new DevUIAggregatorHostedService(
68+
resource,
69+
e.Services.GetRequiredService<ILoggerFactory>().CreateLogger<DevUIAggregatorHostedService>(),
70+
e.Services.GetService<IConfiguration>());
6771

6872
try
6973
{

0 commit comments

Comments
 (0)