diff --git a/changelog.md b/changelog.md index 85ff22c81..1295402b6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,15 +1,15 @@ -# Microsoft 365 Agents SDK for Python - Release Notes v1.10.0 (Unreleased) +# Microsoft 365 Agents SDK for Python - Release Notes v1.10.0 -**Release Date:** Unreleased +**Release Date:** 2026-11-19 **Previous Version:** 1.9.0 (Released 2026-10-19) ## Breaking Changes -- **Python Support**: Python 3.10 is no longer supported. Upgrade to Python 3.11 or later before updating the SDK. +- **Python Support**: Python 3.10 is no longer supported. Upgrade to Python 3.11 or later before updating the SDK (#640). -## microsoft_agents.activity: Configuration +## Configuration -Added `microsoft_agents.activity.config.Configuration` for typed reads, nested sections, wildcard collection, and settings binding from ordinary dictionaries (#636, #649). +Added `microsoft_agents.activity.config.Configuration` for typed reads, nested sections, wildcard collection, and settings binding from ordinary dictionaries (#636, #649, #653). Previously, each component parsed its own settings from raw dictionaries or `AgentAuthConfiguration`, with inconsistent key matching and type conversion. `Configuration` gives every component one consistent way to read settings, closer to .NET's `IConfiguration`. @@ -40,19 +40,21 @@ Use `load_configuration_from_env(os.environ)` to expand environment-style names ## Major Features & Enhancements - **Application Options Configuration**: Added `ApplicationOptions.from_config()` to bind scoped settings or the application-root `AgentApplication` section. Pass the resulting options to `AgentApplication(options=...)` to use nested settings; constructor keyword arguments continue to read only top-level options for backward compatibility (#656). -- **Teams API Dependency**: Updated `microsoft-agents-hosting-msteams` to use `microsoft-teams-api` 2.2.0, including HTTPX2 transport, nullable meeting join URLs, and typed chat, reply-chain, and source channel data. +- **Teams API Dependency**: Updated `microsoft-agents-hosting-msteams` to use `microsoft-teams-api` 2.2.0, including HTTPX2 transport, nullable meeting join URLs, and typed chat, reply-chain, and source channel data (#657). - **JWT Authorization Configuration**: Added `ConnectionSettingsBase`, `JwtConnectionSettings`, and `TokenValidationConfig` to bind inbound JWT policies from application configuration, including explicit audiences, tenant and anonymous-access overrides, and per-connection issuer settings. Retained legacy `AgentAuthConfiguration` support and added application-scoped validator caching without changing `Connections` or `ConnectionManager` (#638). - **Explicit JWT Audience Lists**: Scalar and delimited audience strings now bind as explicit allow-lists instead of falling back to all configured connection client IDs. Missing or empty audiences continue to use connection defaults (#638). -- **Connection Configuration**: Added `Configuration`-based initialization to `ConnectionManager` and `MsalConnectionManager`, with typed audience/service-URL routing maps supporting lists and named mappings. Consolidated shared connection APIs under `authorization.connections` while retaining legacy import paths and constructor inputs. -- **Typed Authentication Provider Settings**: Added `MsalConnectionSettings` and migrated `SidecarConnectionSettings` to derive from `ConnectionSettingsBase`. MSAL and Entra sidecar providers now accept bound settings or `Configuration` and expose typed settings through `.config`, while retaining legacy `AgentAuthConfiguration` inputs and existing environment-variable names. -- **Typed User Authorization Configuration**: Added `AuthorizationConfig` and `AuthHandlerConfig` for application sign-in options and individual OAuth handlers. `Authorization` accepts configuration through `config=` and supports explicit handler lists or dictionaries. -- **Shared Configuration API**: Added a dictionary-backed `Configuration` API with nested path and alias lookup, typed getters, wildcard collection, configurable settings binding, and mapping/default resolution with indexed-list normalization. Retained the existing `load_configuration_from_env()` return contract (#636). +- **Connection Configuration**: Added `Configuration`-based initialization to `ConnectionManager` and `MsalConnectionManager`, with typed audience/service-URL routing maps supporting lists and named mappings. Consolidated shared connection APIs under `authorization.connections` while retaining legacy package-level imports and constructor inputs (#642). +- **Typed Authentication Provider Settings**: Added `MsalConnectionSettings` and migrated `SidecarConnectionSettings` to derive from `ConnectionSettingsBase`. MSAL and Entra sidecar providers now accept bound settings or `Configuration` and expose typed settings through `.config`, while retaining legacy `AgentAuthConfiguration` inputs and existing environment-variable names (#642). +- **Typed User Authorization Configuration**: Added `AuthorizationConfig` and `AuthHandlerConfig` for application sign-in options and individual OAuth handlers. `Authorization` accepts configuration through `config=` and supports explicit handler lists or dictionaries (#644, #649). +- **Shared Configuration API**: Added a dictionary-backed `Configuration` API with nested path and alias lookup, typed getters, wildcard collection, configurable settings binding, and mapping/default resolution with indexed-list normalization. Retained the existing `load_configuration_from_env()` return contract (#636, #649, #653). ## Deprecation -- **Legacy Configuration Entry Points**: Prefer explicit `config=` arguments over unpacked configuration keyword arguments in connection managers and `Authorization`. Prefer typed provider `.config` settings over legacy `.configuration` access, and `AuthHandlerConfig` over the deprecated `AuthHandler` constructor. Legacy entry points remain available with deprecation warnings. + +- **Legacy Configuration Entry Points**: Prefer explicit `config=` arguments over unpacked configuration keyword arguments in connection managers and `Authorization`. Prefer typed provider `.config` settings over legacy `.configuration` access, and `AuthHandlerConfig` over the deprecated `AuthHandler` constructor. Legacy entry points remain available with deprecation warnings (#642, #644, #649). ## Bug Fixes -- **Channel Service Client Cleanup**: Fixed unclosed connector and user-token clients when conversation creation fails or is cancelled, or when client initialization fails during proactive or incoming activity processing (#650). + +- **Channel Service Client Cleanup**: Fixed unclosed connector and user-token clients when conversation creation fails or is cancelled, or when client initialization fails during proactive or incoming activity processing (#651). --- diff --git a/dev/integration/tests/agentic/test_agentic_header_propagation.py b/dev/integration/tests/agentic/test_agentic_header_propagation.py index 005c6295d..ba7e0886e 100644 --- a/dev/integration/tests/agentic/test_agentic_header_propagation.py +++ b/dev/integration/tests/agentic/test_agentic_header_propagation.py @@ -16,6 +16,7 @@ AgentAuthConfiguration, ApplicationOptions, Authorization, + ConnectionSettingsBase, ConnectorClientBase, MemoryStorage, TurnContext, @@ -26,8 +27,13 @@ class _FakeTokenProvider: def __init__(self): + self._config = ConnectionSettingsBase() self._configuration = AgentAuthConfiguration() + @property + def config(self) -> ConnectionSettingsBase: + return self._config + @property def configuration(self) -> AgentAuthConfiguration: return self._configuration diff --git a/libraries/microsoft-agents-activity/microsoft_agents/activity/config/_load_configuration.py b/libraries/microsoft-agents-activity/microsoft_agents/activity/config/_load_configuration.py index da65ea08c..d6f37cff6 100644 --- a/libraries/microsoft-agents-activity/microsoft_agents/activity/config/_load_configuration.py +++ b/libraries/microsoft-agents-activity/microsoft_agents/activity/config/_load_configuration.py @@ -29,7 +29,7 @@ def _is_sdk_section(key: Any) -> bool: return section.casefold() in _SDK_SECTIONS -def load_configuration_from_env(config_dict: Mapping[str, Any], /) -> Configuration: +def load_configuration_from_env(env_vars: Mapping[str, Any]) -> Configuration: """Load application settings from environment variables or a dictionary. Pass ``os.environ`` to read the current process environment, or supply your @@ -58,18 +58,46 @@ def load_configuration_from_env(config_dict: Mapping[str, Any], /) -> Configurat >>> config.get("PATH") is None True - The result represents the full application configuration. APIs such as - ``Authorization`` can use it to find their own sections automatically. - If a ``logging`` section is present, its log levels are applied as well. + The result is marked as application-root configuration: it represents + settings for the whole SDK application. Root-aware settings binders select + their own sections; for example, ``ApplicationOptions.from_config(config)`` + reads the ``AgentApplication`` section. + + By contrast, ``Configuration({...})`` constructed from ordinary data is + not marked as root. Binders treat that input as settings already scoped + to one component. They do not infer root scope from section names. + Wrapping a full application dictionary directly can therefore cause + nested settings to be overlooked and defaults to be used instead. + + Use this loader for full application settings, including already-nested + dictionaries. Use ``get_section()`` to pass an explicit component section. + For example, these bindings produce equivalent options:: + + from microsoft_agents.hosting.core import ApplicationOptions + + root = load_configuration_from_env({ + "AgentApplication": {"StartTypingTimer": "false"}, + }) + scoped = root.get_section("AgentApplication") + + assert ApplicationOptions.from_config(root).start_typing_timer is False + assert ApplicationOptions.from_config(scoped).start_typing_timer is False + + For ``AgentApplication``, pass the bound settings through + ``options=ApplicationOptions.from_config(root)``. Passing ``config=root`` + alone does not bind nested application options. + + If a ``Logging`` section is present, its configured log levels are + applied as well. This function accepts one dictionary. If settings come from several sources, combine them first and decide which source should take precedence. - :param config_dict: Environment variables or other application settings. + :param env_vars: Environment variables or other application settings. :return: Configuration ready to pass to SDK application components. """ sdk_settings = { - key: value for key, value in config_dict.items() if _is_sdk_section(key) + key: value for key, value in env_vars.items() if _is_sdk_section(key) } config = Configuration(_resolve(sdk_settings)) _RootConfigMetadata.set(config, True) diff --git a/libraries/microsoft-agents-activity/readme.md b/libraries/microsoft-agents-activity/readme.md index 27339e5dd..a5e950621 100644 --- a/libraries/microsoft-agents-activity/readme.md +++ b/libraries/microsoft-agents-activity/readme.md @@ -15,6 +15,15 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe