Skip to content

Fix: align crew ai sample with A365 Observability SDK breaking changes#279

Open
Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Yogeshp-MSFT:CrewAi-sample
Open

Fix: align crew ai sample with A365 Observability SDK breaking changes#279
Yogeshp-MSFT wants to merge 4 commits intomicrosoft:mainfrom
Yogeshp-MSFT:CrewAi-sample

Conversation

@Yogeshp-MSFT
Copy link
Copy Markdown

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)

Old API New API Files
TenantDetails UserDetails turn_context_utils.py, agent.py, host_agent_server.py
InvokeAgentDetails InvokeAgentScopeDetails turn_context_utils.py
ExecutionType (removed) dropped from Request turn_context_utils.py
CallerDetails(caller_id=, caller_upn=, ...) CallerDetails(user_details=UserDetails(...)) turn_context_utils.py
AgentDetails(agent_auid=) AgentDetails(agentic_user_id=) turn_context_utils.py
BaggageBuilder.correlation_id() BaggageBuilder.session_id() host_agent_server.py
InvokeAgentScope.start(invoke_agent_details=, tenant_details=) InvokeAgentScope.start(scope_details=, agent_details=) agent.py, host_agent_server.py
InferenceScope.start(tenant_details=) InferenceScope.start(user_details=) agent.py
ExecuteToolScope.start(tenant_details=) ExecuteToolScope.start(request=, user_details=) mcp_observable_tools.py

Configuration Changes (2 files)

  • agents.yaml: Removed hardcoded llm: azure/gpt-4o from both agents — LLM is now resolved dynamically from OPENAI_MODEL_NAME env var
  • pyproject.toml: Bumped microsoft-agents-* minimum versions from >=0.7.0 to >=0.9.0

Files Changed (7)

  • turn_context_utils.py — Core SDK model migrations
  • agent.py — Updated observability scope calls and context vars
  • host_agent_server.py — Updated scope calls and baggage builder
  • mcp_observable_tools.py — Added Request import, updated ExecuteToolScope
  • agents.yaml — Removed hardcoded LLM
  • pyproject.toml — Bumped SDK version constraints
  • design.md — Updated design documentation

Testing

  • Verified end-to-end locally using M365 Agents Playground
  • Tested with prompt: "What is the current weather for Dallas, Texas?" — agent successfully fetched weather and returned tire safety recommendations
  • All observability scopes (InvokeAgentScope, InferenceScope, ExecuteToolScope) emit correctly

Notes

  • All A365 packages resolve to pre-release 0.3.0.dev4 and Agents SDK to 0.10.0.dev1 — this is expected since microsoft-agents-a365-observability-hosting has no stable release on PyPI yet
  • [tool.uv] prerelease = "allow" in pyproject.toml is required for resolution

Copilot AI review requested due to automatic review settings April 20, 2026 11:28
@Yogeshp-MSFT Yogeshp-MSFT requested a review from a team as a code owner April 20, 2026 11:28
@Yogeshp-MSFT Yogeshp-MSFT changed the title Fix: align with A365 Observability SDK breaking changes Fix: align crew ai sample with A365 Observability SDK breaking changes Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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., TenantDetailsUserDetails, updated scope start(...) signatures).
  • Updates MCP tool observability to supply a Request and user_details to ExecuteToolScope.
  • Removes hardcoded agent llm entries 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.

Comment thread python/crewai/sample_agent/turn_context_utils.py
Comment thread python/crewai/sample_agent/turn_context_utils.py Outdated
Comment thread python/crewai/sample_agent/agent.py
Comment thread python/crewai/sample_agent/mcp_observable_tools.py Outdated
Comment thread python/crewai/sample_agent/mcp_observable_tools.py
Comment thread python/crewai/sample_agent/turn_context_utils.py
Comment thread python/crewai/sample_agent/agent.py Outdated
Comment thread python/crewai/sample_agent/agent.py Outdated
Comment thread python/crewai/sample_agent/host_agent_server.py Outdated
@Yogeshp-MSFT
Copy link
Copy Markdown
Author

hi @biswapm can you review this pr?

Yogeshp-MSFT and others added 4 commits April 29, 2026 16:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed an extra newline before logger initialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants