Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors MCP tool registration services across multiple frameworks to simplify initialization and improve logging consistency. It also adds a new Agent Framework extension library with comprehensive tooling support.
- Simplified constructor patterns by removing optional dependency injection parameters
- Added consistent logging throughout MCP tool registration workflows
- Created new Agent Framework extension package with MCP tool registration capabilities
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mcp_tool_registration_service.py (semantickernel) | Removed optional constructor parameters, now directly instantiates McpToolServerConfigurationService and removed null check |
| mcp_tool_registration_service.py (openai) | Added copyright header, logger support, and comprehensive logging statements throughout tool registration workflow |
| setup.py (agentframework) | New setup file with dynamic versioning based on UTC timestamp |
| pyproject.toml (agentframework) | New project configuration for Agent Framework extension package |
| mcp_tool_registration_service.py (agentframework) | New implementation of MCP tool registration service for Agent Framework with full logging support |
| init.py (agentframework/services) | New module initialization exporting McpToolRegistrationService |
| init.py (agentframework) | New package initialization with comprehensive module documentation |
| README.md (agentframework) | New comprehensive documentation for the Agent Framework extension library |
...xtensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/__init__.py
Show resolved
Hide resolved
...ions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
...soft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...soft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
...soft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py
Show resolved
Hide resolved
...soft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py
Show resolved
Hide resolved
...soft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml
Show resolved
Hide resolved
…/github.com/microsoft/Agent365-python into users/mrunalhirve/AgentFrameworkSDKInPython
libraries/microsoft-agents-a365-tooling-extensions-agentframework/setup.py
Show resolved
Hide resolved
libraries/microsoft-agents-a365-tooling-extensions-agentframework/setup.py
Show resolved
Hide resolved
libraries/microsoft-agents-a365-tooling-extensions-agentframework/README.md
Outdated
Show resolved
Hide resolved
...ions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
…osoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...soft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py
Show resolved
Hide resolved
...-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/services/__init__.py
Show resolved
Hide resolved
...xtensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/__init__.py
Show resolved
Hide resolved
…/github.com/microsoft/Agent365-python into users/mrunalhirve/AgentFrameworkSDKInPython
libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml
Outdated
Show resolved
Hide resolved
…ork/pyproject.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
libraries/microsoft-agents-a365-tooling-extensions-agentframework/README.md
Outdated
Show resolved
Hide resolved
libraries/microsoft-agents-a365-tooling-extensions-agentframework/README.md
Outdated
Show resolved
Hide resolved
…ork/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ork/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
libraries/microsoft-agents-a365-tooling-extensions-agentframework/README.md
Show resolved
Hide resolved
pontemonti
previously approved these changes
Oct 31, 2025
…/github.com/microsoft/Agent365-python into users/mrunalhirve/AgentFrameworkSDKInPython
pontemonti
approved these changes
Oct 31, 2025
Copilot AI
added a commit
that referenced
this pull request
Mar 16, 2026
… asserts, and more - Fix #1: Downgrade sensitive data logging from INFO to DEBUG in agent365_exporter.py - Fix #2: Fix unpaired context.attach() in opentelemetry_scope.py add_baggage() by storing and detaching baggage tokens on scope end - Fix #3: Add bounded OrderedDict caps to unbounded dicts in OpenAI trace_processor.py - Fix #4: Replace 30 assert statements with proper TypeError raises in LangChain utils.py - Fix #5: Log security warning when HTTP domain override is detected - Fix #6: Warn when bearer token sent over non-HTTPS connection - Fix #10: Respect Retry-After header and use exponential backoff in retries - Fix #13: Rename reset() to _reset() in ObservabilityHostingManager - Fix #15: Replace print() with logger.warning() in LangChain tracer_instrumentor.py Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
nikhilNava
added a commit
that referenced
this pull request
Mar 17, 2026
* Initial plan * Replace assert statements with explicit TypeError raises in langchain utils Replace all 30 assert statements in utils.py with equivalent if-not-raise TypeError checks. This ensures type validation is not silently stripped when Python runs with -O (optimized mode). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * security: fix sensitive data logging, context leak, unbounded memory, asserts, and more - Fix #1: Downgrade sensitive data logging from INFO to DEBUG in agent365_exporter.py - Fix #2: Fix unpaired context.attach() in opentelemetry_scope.py add_baggage() by storing and detaching baggage tokens on scope end - Fix #3: Add bounded OrderedDict caps to unbounded dicts in OpenAI trace_processor.py - Fix #4: Replace 30 assert statements with proper TypeError raises in LangChain utils.py - Fix #5: Log security warning when HTTP domain override is detected - Fix #6: Warn when bearer token sent over non-HTTPS connection - Fix #10: Respect Retry-After header and use exponential backoff in retries - Fix #13: Rename reset() to _reset() in ObservabilityHostingManager - Fix #15: Replace print() with logger.warning() in LangChain tracer_instrumentor.py Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Restore agent/tenant IDs and response text in exporter log messages Agent IDs and tenant IDs are not sensitive data and are useful for debugging. Restore them in debug/error log messages. Also restore truncated response text in HTTP error logs to help developers debug failures. Log levels remain at DEBUG (from the prior security fix). Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Remove add_baggage() from OpenTelemetryScope The method had an unpaired context.attach() that leaked context tokens. Users should use BaggageBuilder.build() context manager instead, which properly restores the previous context on exit. Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Security hardening for observability packages Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Fix formatting in test_agent365_exporter.py and replace remaining raise TypeError with isinstance guards in langchain utils.py Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Move _parse_retry_after to exporters/utils.py as standalone parse_retry_after function Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Replace type(e).__name__ with str(e) in exporter error logging per PR review Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * feat: add bounded collections for LangChain tracer and OutputScope - Convert LangChain _spans_by_run from unbounded DictWithLock to bounded OrderedDict with _MAX_TRACKED_RUNS=10000 cap - Add _cap_ordered_dict helper for FIFO eviction (matching OpenAI pattern) - Add thread-safe lock usage for _spans_by_run in error handlers - Add _MAX_OUTPUT_MESSAGES=5000 cap for OutputScope._output_messages - Add unit tests for both bounded collections Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> Co-authored-by: Nikhil Navakiran <nikhil.navakiran@gmail.com>
biswapm
pushed a commit
to biswapm/Agent365-python
that referenced
this pull request
Mar 20, 2026
* Initial plan * Replace assert statements with explicit TypeError raises in langchain utils Replace all 30 assert statements in utils.py with equivalent if-not-raise TypeError checks. This ensures type validation is not silently stripped when Python runs with -O (optimized mode). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * security: fix sensitive data logging, context leak, unbounded memory, asserts, and more - Fix microsoft#1: Downgrade sensitive data logging from INFO to DEBUG in agent365_exporter.py - Fix microsoft#2: Fix unpaired context.attach() in opentelemetry_scope.py add_baggage() by storing and detaching baggage tokens on scope end - Fix microsoft#3: Add bounded OrderedDict caps to unbounded dicts in OpenAI trace_processor.py - Fix microsoft#4: Replace 30 assert statements with proper TypeError raises in LangChain utils.py - Fix microsoft#5: Log security warning when HTTP domain override is detected - Fix microsoft#6: Warn when bearer token sent over non-HTTPS connection - Fix microsoft#10: Respect Retry-After header and use exponential backoff in retries - Fix microsoft#13: Rename reset() to _reset() in ObservabilityHostingManager - Fix microsoft#15: Replace print() with logger.warning() in LangChain tracer_instrumentor.py Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Restore agent/tenant IDs and response text in exporter log messages Agent IDs and tenant IDs are not sensitive data and are useful for debugging. Restore them in debug/error log messages. Also restore truncated response text in HTTP error logs to help developers debug failures. Log levels remain at DEBUG (from the prior security fix). Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Remove add_baggage() from OpenTelemetryScope The method had an unpaired context.attach() that leaked context tokens. Users should use BaggageBuilder.build() context manager instead, which properly restores the previous context on exit. Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Security hardening for observability packages Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Fix formatting in test_agent365_exporter.py and replace remaining raise TypeError with isinstance guards in langchain utils.py Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Move _parse_retry_after to exporters/utils.py as standalone parse_retry_after function Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * Replace type(e).__name__ with str(e) in exporter error logging per PR review Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> * feat: add bounded collections for LangChain tracer and OutputScope - Convert LangChain _spans_by_run from unbounded DictWithLock to bounded OrderedDict with _MAX_TRACKED_RUNS=10000 cap - Add _cap_ordered_dict helper for FIFO eviction (matching OpenAI pattern) - Add thread-safe lock usage for _spans_by_run in error handlers - Add _MAX_OUTPUT_MESSAGES=5000 cap for OutputScope._output_messages - Add unit tests for both bounded collections Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com> Co-authored-by: Nikhil Navakiran <nikhil.navakiran@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added tooling sdk for Agents Framework
Limitation with Microsoft.Extensions.AI Framework Architecture
The Microsoft.Extensions.AI framework (which likely underlies the agent infrastructure) follows an immutable configuration pattern where:
• Tool definitions are part of the agent's core configuration
• The agent's execution context is optimized around a fixed set of tools
• Runtime tool modification would require rebuilding the entire agent context
Hence there is no way to update the agent with new tools
Package Update
microsoft-agents-a365-observability-core[jaeger] depends on opentelemetry-exporter-jaeger >= 1.20.0
microsoft-agents-a365-tooling-extensions-agentframework[dev] depends on agent-framework-azure-ai >= 0.1.0 which in turn depends on agent-framework-core
agent-framework-core depends on opentelemetry-exporter-otlp-proto-grpc >= 1.36.0
There's a conflict with the protobuf and googleapis-common-protos versions between these OpenTelemetry packages