* fix: HandoffAgentExecutor does not output any reponse when non-streaming
* fix: Ensure Workflow outputs persisted in chat history when hosted AsAgent
* fix: Remove duplicate history entry creation and ad test
* test: Add streaming tests for AsAgent to smoke tests
* feat: Add output configurability to Handoffs
* refactor: [BREAKING] Config => ExecutorConfig
Make the Config name less likely to collide with other classes by renaming to ExecutorConfig. Makes Configured and related classes internal as they do not need to be part of the public surface.
* fix: Make RouteBuilder explicit in SourceGen to avoid conflicts
* Handle external input request and response conversion for workflow as agent scenario
* Remove unnecessary test comment
* Fix PR comments
* Updated to fix edge cases, and add more tests.
* Update pending requests to use typed properties instead of relying on StateBag. replying to PR feedback.
* Fixed external response de-dup and updated possible brittle test.
* Address PR comments on sending turn token for normal messages and handle contentId collision by source agent
* Remove unnecessary serialization element and address pr comment on intercepted outgoing requests
* Updated MEAI changes for UserInput request and response abstractions.
* Expose workflow as MCP Tool
* Expose workflow as MCP Tool
* Cleanup
* PR feedback fixes
* update changelog to include PR numner
* Improvements to error handling.
* Adding a sample project demonstrating how to setup Agents and Workflows together.
* Ensure duplicate agent registrations are properly handled.
The `sessionId`, an optional parameter when starting a new session when
running a workflow is an arbitrary string. This allows consumers to
support whatever ids are needed by other systems, but can result in
errors when an OS special or forbidden character is included.
The fix is to escape the paths, in a 1:1 manner. We rely on
EncodeDataString to do this.
* Also modifies the index file to make it easier to determine what the
name of the file on disk is for a given `sessionId`.
* Persist messages during the Function Call Loop
* Revert version reset
* Fix bugs and improve sample
* Fix formatting issues
* Also updating conversation id during run
* Update based on ADR feedback
Azure.AI.Agents.Persistent 1.2.0-beta.10 now targets ME.AI 10.4.0+,
resolving the compatibility issue that required disabling this package.
- Remove IsPackable=false from the csproj
- Re-enable all 6 integration test classes (IntegrationDisabled → Integration)
- Remove outdated compatibility warning from README.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix PydanticSchemaGenerationError with PEP 563 annotations in @tool
_resolve_input_model used raw param.annotation from inspect.signature(),
which returns string annotations when 'from __future__ import annotations'
is active (PEP 563). This caused Pydantic's create_model to fail for
complex types like Optional[int] or FunctionInvocationContext.
Use typing.get_type_hints() to resolve annotations to actual types before
passing them to create_model, matching the approach already used by
_discover_injected_parameters.
Fixes#4809
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report and unused test imports
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(tests): strengthen PEP 563 regression tests per review feedback (#4809)
- Verify type correctness in schema assertions (not just key presence)
- Fix ctx annotation to FunctionInvocationContext | None for type consistency
- Add test for Optional[CustomType] pattern (original bug trigger)
- Add test for get_type_hints() fallback with unresolvable forward refs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Address review feedback for #4809: Python: [Bug]: PydanticSchemaGenerationError in FunctionInvocationContext
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump HostedAgents samples to AgentFramework beta.11 and pass credential to UseFoundryTools
Update all 8 HostedAgents samples:
- Azure.AI.AgentServer.AgentFramework -> 1.0.0-beta.11
- Microsoft.Agents.AI.OpenAI -> 1.0.0-rc4
- Microsoft.Agents.AI/AzureAI/Workflows -> 1.0.0-rc4
- Azure.AI.Projects -> 2.0.0-beta.1
- Fix Workflow.AsAgent() -> AsAIAgent() in FoundryMultiAgent
- Pass credential to UseFoundryTools in AgentWithTools (resolves#56802)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove AgentWithTools sample (UseFoundryTools no longer supported)
Remove the AgentWithTools hosted agent sample as the UseFoundryTools
backend is no longer supported. Updated HostedAgents README and solution
file to remove all references.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix AgentWithHostedMCP: downgrade Azure.AI.OpenAI to 2.8.0-beta.1 for rc4 compatibility
Azure.AI.OpenAI 2.9.0-beta.1 has breaking changes (GetResponsesClient no
longer accepts deployment name, ResponsesClient.Model removed) that are
incompatible with Microsoft.Agents.AI.OpenAI rc4. Pin to 2.8.0-beta.1 and
use GetResponsesClient(deploymentName).AsAIAgent() pattern.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix source generator bug that silently drops base class handler registrations for protocol-only partial executors
* Fixed xml comments and variable naming.
* Fix workflow samples broken due to routing change
* Add ADR-0020: Foundry Evals integration design
Captures the design for integrating Azure AI Foundry Evaluations with
agent-framework. Key decisions:
- EvalItem with conversation (list[Message]) as single source of truth
- query/response derived from configurable conversation split strategies
- Tools as list[FunctionTool] (including auto-extracted MCP tools)
- FoundryEvals provider with auto-detection of evaluator capabilities
- LocalEvaluator with @function_evaluator decorator for local checks
- Consistent Python/C# APIs: evaluate_agent, evaluate_workflow
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Mark ADR 0020 Foundry Evals as accepted
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: alliscode <bentho@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: avoid duplicate agent response telemetry
* Python: conditionally suppress duplicate agent telemetry
* Simplify telemetry ownership tracking
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Aggregate token usage from inner chat spans on invoke_agent span
The invoke_agent span now carries the aggregated input/output token
counts from all inner chat completion spans that occur during an agent
run. Previously, when inner ChatTelemetryLayer spans captured usage,
the outer AgentTelemetryLayer skipped setting usage entirely to avoid
duplication. Now a new INNER_ACCUMULATED_USAGE context variable tracks
cumulative usage across all inner completions, and the agent span
always reports the total.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-20 10:09:46 +00:00
* Deprecate Azure AI v1 (Persistent Agents API) helper methods
Add DeprecationWarning to v1 classes and functions that have been
superseded by the v2 (Projects/Responses) API:
- AzureAIAgentsProvider -> use AzureAIProjectAgentProvider
- AzureAIAgentClient -> use AzureAIClient
- AzureAIAgentOptions -> use AzureAIProjectAgentOptions
- to_azure_ai_agent_tools() -> use to_azure_ai_tools()
- from_azure_ai_agent_tools() -> use from_azure_ai_tools()
- AzureAIAgentClient static tool factory methods -> use AzureAIClient equivalents
All v1 components still function but emit warnings to guide migration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add deprecation warnings to AzureAIAgentsProvider methods
Mark create_agent(), get_agent(), and as_agent() as deprecated
individually, pointing to AzureAIProjectAgentProvider equivalents.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Emit tool call events in GitHubCopilotAgent streaming
_stream_updates now yields FunctionCallContent for TOOL_EXECUTION_START
and FunctionResultContent for TOOL_EXECUTION_COMPLETE events from the
Copilot SDK session. This enables DevUI and other consumers to display
tool calls during streaming agent execution. Previously only ASSISTANT_MESSAGE_DELTA, SESSION_IDLE, and SESSION_ERROR
were handled — tool execution events were silently dropped.
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Add some tests
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Respond to feedback
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Fix TOOL_EXECUTION_COMPLETE to use correct SDK types
- Read result text from session_events.Result.content (not ToolResult.text_result_for_llm)
- Read failure state from event.data.success/error (not result_obj.result_type/error)
- Handle ErrorClass.message and plain string errors
- Update tests to use session_events.Result and ErrorClass
- Add tests for string errors, success-with-error, and COMPLETE missing fields
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
---------
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* [BREAKING] Refactor middleware layering and raw clients
Reorder chat client layers so function invocation wraps chat middleware, and chat middleware stays outside telemetry while still running for each inner model call. Add middleware pipeline caching, refresh docs and samples, and split Anthropic into raw and public clients to match the standard layering model.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Tighten typing ignores in ancillary modules
Add targeted typing ignores in workflow visualization and lab modules so pyright stays clean alongside the middleware refactor work.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix categorize_middleware to unpack tuple/Sequence and use relative MRO assertions
- Broaden isinstance check in categorize_middleware from list to Sequence
so tuples and other Sequence types are properly unpacked instead of
being appended as a single item.
- Replace fragile hardcoded MRO index assertions in anthropic test with
relative ordering via mro.index().
- Add regression tests for categorize_middleware with tuple, list, and
None inputs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix middleware string decomposition, add middleware param to FunctionInvocationLayer, and add tests (#4710)
- Guard categorize_middleware Sequence check against str/bytes to prevent
character-by-character decomposition of accidentally passed strings
- Add explicit middleware parameter to FunctionInvocationLayer.get_response
and merge it into client_kwargs before categorization, fixing the
inconsistency where only OpenAIChatClient supported this parameter
- Add assertions that RawAnthropicClient does not inherit convenience layers
- Add chat middleware cache test with non-empty base middleware
- Add tests for single unwrapped middleware item and string input
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Apply pre-commit auto-fixes
* Address review feedback for #4710: review comment fixes
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Eduard van Valkenburg
·
2026-03-20 00:43:37 +00:00
* Emit TOOL_CALL_RESULT events on approval resume (#4589)
When a tool call is approved via the interrupt/resume flow,
_resolve_approval_responses executes the tool and injects the result
into the messages array, but no TOOL_CALL_RESULT SSE event was yielded
to the client.
Changes:
- _resolve_approval_responses now returns the list of resolved
function_result Content objects instead of None
- run_agent_stream yields ToolCallResultEvent for each resolved
approval result after RunStartedEvent is emitted
- Add ToolCallResultEvent to ag_ui.core imports in _agent_run.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* fix(ag-ui): address PR review feedback for #4589
1. _resolve_approval_responses now returns only approved results (not
rejections) so TOOL_CALL_RESULT events are emitted only for executed
tools. Rejection results are still written into message history.
2. Emit resolved TOOL_CALL_RESULT events in the no-updates fallback
RUN_STARTED path so approval results are never lost.
3. Rewrite tests to use real FunctionTool with func and
approval_mode='always_require' via StubAgent default_options,
verifying actual tool execution output in TOOL_CALL_RESULT content.
Added test for rejection not emitting TOOL_CALL_RESULT.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix#4589: clean up approval resolution and add missing tests
- Extract duplicated TOOL_CALL_RESULT emission block into
_make_approval_tool_result_events helper to prevent drift
- Remove dead rejection_results construction in _resolve_approval_responses;
_replace_approval_contents_with_results already handles rejections inline
- Pass only approved_results (not all_results) to clarify the contract
- Add mixed approve/reject test validating the core splitting logic
- Add zero-updates test covering the no-updates fallback emission path
- Add direct unit test for _resolve_approval_responses return value
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Fix import sorting lint error in test_approval_result_event.py
Add blank line between first-party and third-party import groups
to satisfy ruff I001 rule.
Fixes#4589
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Emit AG-UI events for MCP tool calls, results, and text reasoning
Fixes#4213 — `_emit_content()` in the AG-UI layer only handled `text`,
`function_call`, `function_result`, `function_approval_request`, `usage`,
and `oauth_consent_request` content types. Foundry MCP content types
(`mcp_server_tool_call`, `mcp_server_tool_result`) and `text_reasoning`
fell through unhandled, producing no SSE events for AG-UI consumers.
Added three new handler functions wired into `_emit_content()`:
- `_emit_mcp_tool_call`: emits TOOL_CALL_START + TOOL_CALL_ARGS and
tracks in FlowState for MESSAGES_SNAPSHOT inclusion
- `_emit_mcp_tool_result`: emits TOOL_CALL_END + TOOL_CALL_RESULT with
full FlowState cleanup mirroring `_emit_tool_result`
- `_emit_text_reasoning`: emits the protocol-defined reasoning event
sequence (ReasoningStart → MessageStart → MessageContent → MessageEnd
→ ReasoningEnd) with ReasoningEncryptedValueEvent for protected_data
* Add HTTP round-trip tests for MCP tool and reasoning SSE events
Exercises the full POST → SSE bytes → parse → validate pipeline for
mcp_server_tool_call, mcp_server_tool_result, text_reasoning, and
ReasoningEncryptedValueEvent content through FastAPI TestClient.
* Fix _emit_mcp_tool_result missing predictive_handler support (#4213)
- Add predictive_handler parameter to _emit_mcp_tool_result and mirror
the apply_pending_updates + StateSnapshotEvent block from _emit_tool_result
- Forward predictive_handler from _emit_content to _emit_mcp_tool_result
- Add assertion for stored arguments in MCP tool call test
- Add test for predictive handler state snapshot after MCP tool result
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Refactor MCP tool emit functions and add missing tests (#4213)
- Extract _emit_tool_result_common shared helper to eliminate duplication
between _emit_tool_result and _emit_mcp_tool_result
- Remove server_name prefix from tool_call_name in _emit_mcp_tool_call;
display_name now equals tool_name directly
- Add test for tool_name fallback to 'mcp_tool' when tool_name is None
- Add test for output=None fallback to empty string in _emit_mcp_tool_result
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #4213: review comment fixes
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add script to ping on stale issues/PRs
* Add script to ping on stale issues/PRs
* Fix stale issue/PR ping script review comments
- Rename TEAM_NAME env var to TEAM_SLUG for clarity
- Add actionable error messages for 403/404 team lookup failures
- Add contents:read permission for actions/checkout
- Use github.event.inputs context with fallback for scheduled runs
- Pin PyGithub to 2.6.0 for reproducible builds
- Fetch comments once in should_ping() to reduce API calls
- Make ping() retry loop idempotent (track comment/label state)
- Validate DAYS_THRESHOLD with helpful error for non-numeric input
- Fix timezone bug: use astimezone() instead of replace(tzinfo=)
- Add comprehensive unit tests (29 tests)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Support detail field in OpenAI image_url payload (#4616)
Include the optional 'detail' field from Content.additional_properties
when building image_url payloads for the OpenAI Chat API, matching the
existing pattern used for 'filename' in document file payloads.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify detail extraction from additional_properties (#4616)
- Remove unnecessary hasattr check; additional_properties is always
initialized as a dict on Content instances.
- Use 'is not None' instead of truthy check to be more precise.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove detail allowlist in chat client to align with responses client
Replace the strict allowlist check ('low', 'high', 'auto') with an
isinstance(detail, str) check so that any valid string detail value is
passed through to OpenAI. This aligns the chat client behavior with the
responses client, which passes detail through unconditionally.
Also add test coverage for:
- Future/unknown string detail values being passed through
- Data URI images (covering the 'data' branch of the match)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix zero-argument MCP tool schema missing 'properties' key (#4540)
MCP servers for zero-argument tools (e.g. matlab-mcp-core-server's
detect_matlab_toolboxes) declare inputSchema as {"type": "object"}
without a "properties" key. OpenAI's API requires "properties" to
be present on object schemas, causing a 400 invalid_request_error.
Normalize inputSchema at MCP ingestion in load_tools() to inject an
empty "properties": {} when it is missing from object-type schemas.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #4540: improve test robustness and add defensive guard
- Look up loaded functions by name instead of index to avoid brittle
ordering assumptions
- Add negative-path test cases: non-object schema (type: string) and
empty schema ({}) to verify guard clause skips them correctly
- Assert original inputSchema dicts are not mutated by load_tools()
- Add defensive guard for tool.inputSchema being None
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for #4540: Python: [Bug]: Local stdio MCP works for calculator but fails for official matlab-mcp-core-server on LM Studio /v1/responses
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix A2AAgent to invoke context providers before and after run
A2AAgent.run() bypassed the context provider lifecycle (before_run/after_run)
that BaseAgent defines as a contract for all agents. This caused A2AAgent to
violate the semantic definition of BaseAgent, resulting in inconsistency with
other agent implementations.
The fix follows the same pattern used by WorkflowAgent:
- Create SessionContext and run before_run on all context providers before
processing the A2A stream
- Collect response updates and run after_run on all context providers after
the stream is fully consumed
- Auto-create a session when context providers are configured but no session
is explicitly passed
Fixes#4754
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report from repository
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review feedback for #4754
- Validate messages when no continuation_token: raise ValueError if
normalized_messages is empty, preventing IndexError on messages[-1]
- Import BaseContextProvider/SessionContext from public agent_framework
package instead of internal agent_framework._sessions module
- Add test for ValueError on run(None) without continuation_token
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Improve test coverage for empty-messages guard in A2AAgent.run (#4754)
- Parameterize test to cover both messages=None and messages=[] inputs
- Add test verifying run(None, continuation_token=...) does not raise
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-19 10:45:42 +00:00
* Fix invoke_agent span to aggregate token usage across LLM calls (#4062)
The FunctionInvocationLayer._get_response() loop was overwriting the
response on each iteration, so usage_details only reflected the last
chat completion call. Now tracks aggregated_usage across all iterations
using add_usage_details() and sets it on the returned response.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Remove reproduction report artifact
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Apply pre-commit auto-fixes
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-19 06:41:33 +00:00
* Fix source generator bug that silently drops base class handler registrations for protocol-only partial executors
* Fixed xml comments and variable naming.
* Fix FileAgentSkillsProvider accepting SkillsInstructionPrompt without {0} placeholder (#4638)
BuildSkillsInstructionPrompt validated only format-string syntax via
string.Format(template, ""), which silently accepted templates without a
{0} placeholder. The generated skills list was then dropped from the final
instructions.
Tighten validation to format with a sentinel string and verify it appears
in the output, rejecting templates that do not reference argument 0 with
an ArgumentException.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix netstandard2.0 compat and simplify prompt template validation (#4638)
- Replace string.Contains(string, StringComparison) with IndexOf for
netstandard2.0/net472 compatibility
- Remove sentinel round-trip check; validate {0} directly on the raw
template string using IndexOf
- Add positive test verifying custom SkillsInstructionPrompt with {0}
is accepted and applied to output
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* updated automation tasks and commands, with alias for the time being
* Restore aggregate test exclusions
Preserve the legacy all-tests scope for test --all by excluding lab and devui from the default aggregate sweep, while still allowing explicit package selection. Also ignore hidden/generated test directories such as .mypy_cache during aggregate discovery.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* updated versions in pre-commit
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-18 18:39:11 +00:00
* Python: Re-read env vars in configure_otel_providers and enable_instrumentation (#4119)
Fix ENABLE_SENSITIVE_DATA and VS_CODE_EXTENSION_PORT env vars being ignored
when load_dotenv() runs after module import. The module-level
OBSERVABILITY_SETTINGS singleton cached env state at import time, and
configure_otel_providers() / enable_instrumentation() never re-read from
os.environ when parameters were None.
Both functions now construct a fresh ObservabilitySettings() to pick up
current env vars when explicit parameters are not provided, matching the
existing behavior of the env_file_path branch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review feedback for #4119: avoid throwaway ObservabilitySettings
- Add _read_bool_env/_read_int_env helpers to read env vars without
constructing a full ObservabilitySettings (which calls create_resource())
- Replace ObservabilitySettings() in enable_instrumentation() and
configure_otel_providers() else-branch with direct env reads
- Add enable_console_exporters parameter to configure_otel_providers()
for override parity with enable_sensitive_data and vs_code_extension_port
- Propagate _resource and _executed_setup in the non-env_file_path branch
- Make existing tests hermetic (clear VS_CODE_EXTENSION_PORT and
ENABLE_CONSOLE_EXPORTERS env vars)
- Add tests: enable_console_exporters env refresh, explicit param overrides
for both enable_instrumentation() and configure_otel_providers()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address remaining review feedback for #4119
- Refresh enable_console_exporters in enable_instrumentation() for
consistency with configure_otel_providers(), so env var changes
after import are picked up by both public API functions
- Make test_configure_otel_providers_reads_env_vs_code_port hermetic
by clearing ENABLE_CONSOLE_EXPORTERS from the environment
- Add test_enable_instrumentation_reads_env_console_exporters to
cover the new refresh behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove unconditional enable_console_exporters overwrite from enable_instrumentation() (#4119)
enable_instrumentation() is documented as not configuring exporters, so
managing enable_console_exporters there was a leaky abstraction. The
unconditional _read_bool_env call silently reset the value to False when
ENABLE_CONSOLE_EXPORTERS was absent from env, clobbering any value
previously set by configure_otel_providers(enable_console_exporters=True).
- Remove the unconditional overwrite line from enable_instrumentation()
- Replace test_enable_instrumentation_reads_env_console_exporters with
test_enable_instrumentation_does_not_touch_console_exporters
- Add regression test: enable_instrumentation() does not clobber a
previously configured enable_console_exporters value
- Add test: explicit enable_sensitive_data param still leaves
enable_console_exporters untouched
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-18 15:58:22 +00:00
* Add two hosted agent samples using the foundry agent
* Refactor formatting and improve readability in main.py
* Add agent-framework dependency to requirements and update copyright notice in main.py files
* Refactor agent imports and update credential handling in hosted agent samples
* Update agent framework dependency in requirements for hosted agents
* chore: update Python version to 3.14 and improve Dockerfile for hosted agents
* feat: add hosted agent samples for Azure AI with local tools and multi-agent workflows
* fix: update Azure AI client import and refactor agent initialization in hotel agent sample
* feat: add hosted agent samples for Seattle hotel search and writer-reviewer workflow
* fix: correct agent name in YAML configuration for local tools agent
* Fix Content serialization in DurableAgentStateUnknownContent (#4719)
DurableAgentStateUnknownContent.from_unknown_content() stored raw Content
objects without converting them to dicts, causing json.dumps to fail in
Azure Durable Functions' entity state serialization. This affected content
types not explicitly handled (e.g., mcp_server_tool_call/result).
The fix converts Content objects to dicts via to_dict() when storing in
DurableAgentStateUnknownContent, and restores them via Content.from_dict()
in to_ai_content().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add to_json and from_json methods to Content class (#4719)
Add to_json() and from_json() methods to the Content class to match the
serialization interface provided by SerializationMixin on other model classes.
Also fix pre-existing pyright type errors in durabletask's
DurableAgentStateUnknownContent.to_ai_content().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review: add type guard, remove to_json, add fallback, and tests
- Remove Content.to_json() per reviewer request (comment 3)
- Add type guard in Content.from_json() for non-dict JSON (comments 1, 4)
- Wrap json.JSONDecodeError as ValueError for consistent exception contract
- Add try/except fallback in to_ai_content() for invalid Content dicts (comment 5)
- Add test_content_to_dict_exclude_none and test_content_to_dict_exclude_fields (comment 2)
- Add test_unknown_content_to_ai_content_fallback_on_invalid_type_dict (comment 5)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Apply pre-commit auto-fixes
* Address review feedback for #4719: review comment fixes
* Remove Content.from_json, move logic to consuming code (#4719)
Remove the from_json convenience method from Content class per review
feedback. This is the same trivial json.loads + from_dict wrapper as
to_json which was already removed. Consumers should call json.loads
and Content.from_dict directly.
Update tests to use Content.from_dict(json.loads(...)) pattern and
remove from_json-specific error handling tests (those errors are
already covered by json.loads and Content.from_dict).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-03-18 08:08:44 +00:00