Fix: align crew ai sample with A365 Observability SDK breaking changes#279
Open
Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Open
Fix: align crew ai sample with A365 Observability SDK breaking changes#279Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Python CrewAI sample agent to stay compatible with breaking API changes in the Microsoft A365 Observability SDK / Agents SDK, and shifts LLM selection away from hardcoded YAML config toward environment-driven configuration.
Changes:
- Migrates observability models/scope calls (e.g.,
TenantDetails→UserDetails, updated scopestart(...)signatures). - Updates MCP tool observability to supply a
Requestanduser_detailstoExecuteToolScope. - Removes hardcoded agent
llmentries and bumps minimum Agents SDK package versions; refreshes design docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| python/crewai/sample_agent/turn_context_utils.py | Migrates observability models/helpers (Agent/Caller/User/Request) and updates baggage builder usage. |
| python/crewai/sample_agent/agent.py | Updates scope start calls, switches contextvars from tenant→user details, and threads new details into inference/tooling paths. |
| python/crewai/sample_agent/host_agent_server.py | Updates baggage builder + InvokeAgentScope.start(...) call shape; wires new helper functions. |
| python/crewai/sample_agent/mcp_observable_tools.py | Updates ExecuteToolScope.start(...) to pass request + user_details; adds Request import/creation. |
| python/crewai/sample_agent/src/crew_agent/config/agents.yaml | Removes hardcoded llm: so runtime model selection can be environment-driven. |
| python/crewai/sample_agent/pyproject.toml | Bumps microsoft-agents-* minimum versions to align with breaking changes. |
| python/crewai/sample_agent/docs/design.md | Updates configuration/dependency documentation for the new SDK and env var expectations. |
Author
|
hi @biswapm can you review this pr? |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…factoring tenant details to user details
Removed an extra newline before logger initialization.
88f367f to
a1eff47
Compare
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.
Summary
Updates the CrewAI sample agent to align with breaking API changes in the Microsoft A365 Observability SDK and Agents SDK. Also removes hardcoded LLM configuration to support dynamic model selection via environment variables.
Changes
SDK API Migration (4 files)
TenantDetailsUserDetailsturn_context_utils.py,agent.py,host_agent_server.pyInvokeAgentDetailsInvokeAgentScopeDetailsturn_context_utils.pyExecutionType(removed)Requestturn_context_utils.pyCallerDetails(caller_id=, caller_upn=, ...)CallerDetails(user_details=UserDetails(...))turn_context_utils.pyAgentDetails(agent_auid=)AgentDetails(agentic_user_id=)turn_context_utils.pyBaggageBuilder.correlation_id()BaggageBuilder.session_id()host_agent_server.pyInvokeAgentScope.start(invoke_agent_details=, tenant_details=)InvokeAgentScope.start(scope_details=, agent_details=)agent.py,host_agent_server.pyInferenceScope.start(tenant_details=)InferenceScope.start(user_details=)agent.pyExecuteToolScope.start(tenant_details=)ExecuteToolScope.start(request=, user_details=)mcp_observable_tools.pyConfiguration Changes (2 files)
agents.yaml: Removed hardcodedllm: azure/gpt-4ofrom both agents — LLM is now resolved dynamically fromOPENAI_MODEL_NAMEenv varmicrosoft-agents-*minimum versions from>=0.7.0to>=0.9.0Files Changed (7)
Requestimport, updatedExecuteToolScopeTesting
InvokeAgentScope,InferenceScope,ExecuteToolScope) emit correctlyNotes
0.3.0.dev4and Agents SDK to0.10.0.dev1— this is expected sincemicrosoft-agents-a365-observability-hostinghas no stable release on PyPI yet[tool.uv] prerelease = "allow"in pyproject.toml is required for resolution