Remove LangChain observability extension and its dependencies - #274
Remove LangChain observability extension and its dependencies#274EvanderDS (EvanderDS) wants to merge 1 commit into
Conversation
Removes the microsoft-agents-a365-observability-extensions-langchain package and its dependencies (langchain-core, langchain-openai, langsmith, and their transitive subtree) from the workspace, following a security/policy review of the LangChain framework. Changes: - Delete libraries/microsoft-agents-a365-observability-extensions-langchain/ - Delete tests/observability/extensions/langchain/ - Remove the package from [tool.uv.workspace] members and [tool.uv.sources] in root pyproject.toml - Remove langchain-core from constraint-dependencies and langchain-openai from dev-dependencies in root pyproject.toml - Update README.md, CLAUDE.md, DEPENDENCIES.md, docs/design.md, and docs/integrating-with-existing-opentelemetry.md to drop references to the removed package - Regenerate uv.lock (langchain-core, langchain-openai, langsmith, and their now-orphaned transitive dependencies all drop out) Local verification: - uv lock / uv sync --locked --all-extras --dev: clean - tox -e verify-constraints: PASS - tox -e lint: PASS - tox -e format: PASS - tox -e py312: 790 passed, 3 skipped, 5 deselected, 0 failed (the 10 fewer passing tests vs. before are exactly the removed package's own test suite) - uv build --all-packages --wheel: all 12 remaining workspace packages build successfully Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
dbezic (@dbezic) Rick Brighenti (@rbrighenti) Krishnadheeraj (@DheerajPannala) could one of you review/approve? (submitted from a fork so I can't formally request review via the UI.) This supersedes #273 (closed) per further review of the underlying advisory scope, which concluded a version bump alone would not resolve the finding for this dependency - full removal was the outcome of that review. Impact analysis is in the PR description above; please pay particular attention to the customer-impact section before merging. |
There was a problem hiding this comment.
🟡 Changes recommended
Address the stale test-installation reference and documentation inconsistencies before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Removes the optional LangChain observability extension, its tests, and related dependencies from the workspace.
Changes:
- Deletes LangChain implementation, metadata, documentation, and tests.
- Removes workspace and dependency declarations.
- Updates repository documentation and integration guidance.
- Regenerates dependency resolution.
File summaries
| File | Reviewed change |
|---|---|
tests/observability/extensions/langchain/test_wrapper_langchain.py |
Deletes LangChain wrapper tests. |
tests/observability/extensions/langchain/test_tracer_bounded.py |
Deletes bounded tracer tests. |
tests/observability/extensions/langchain/integration/test_observability_pipeline.py |
Deletes pipeline integration tests. |
tests/observability/extensions/langchain/integration/test_message_format.py |
Deletes message-format integration tests. |
tests/observability/extensions/langchain/integration/conftest.py |
Deletes integration fixtures. |
tests/observability/extensions/langchain/integration/__init__.py |
Deletes the integration test package marker. |
tests/observability/extensions/langchain/__init__.py |
Deletes the test package marker. |
README.md |
Removes the LangChain package listing. |
pyproject.toml |
Removes the LangChain workspace member and dependencies; an obsolete test installation reference remains elsewhere. |
libraries/microsoft-agents-a365-observability-extensions-langchain/setup.py |
Deletes package build configuration. |
libraries/microsoft-agents-a365-observability-extensions-langchain/README.md |
Deletes package documentation. |
libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml |
Deletes package metadata. |
libraries/microsoft-agents-a365-observability-extensions-langchain/microsoft_agents_a365/observability/extensions/langchain/utils.py |
Deletes LangChain utilities. |
libraries/microsoft-agents-a365-observability-extensions-langchain/microsoft_agents_a365/observability/extensions/langchain/tracer.py |
Deletes the LangChain tracer. |
libraries/microsoft-agents-a365-observability-extensions-langchain/microsoft_agents_a365/observability/extensions/langchain/tracer_instrumentor.py |
Deletes the tracer instrumentor. |
libraries/microsoft-agents-a365-observability-extensions-langchain/microsoft_agents_a365/observability/extensions/langchain/message_mapper.py |
Deletes message mapping logic. |
libraries/microsoft-agents-a365-observability-extensions-langchain/microsoft_agents_a365/observability/extensions/langchain/__init__.py |
Deletes public package exports. |
libraries/microsoft-agents-a365-observability-extensions-langchain/docs/design.md |
Deletes package design documentation. |
libraries/microsoft-agents-a365-observability-extensions-langchain/CHANGELOG.md |
Deletes the package changelog. |
docs/integrating-with-existing-opentelemetry.md |
Removes LangChain integration guidance. |
docs/design.md |
Removes LangChain references; package-count and test-plan documentation require correction. |
DEPENDENCIES.md |
Removes LangChain dependency graph entries. |
CLAUDE.md |
Removes the LangChain extension listing; a stale extension reference remains. |
Review details
Suppressed comments (1)
docs/design.md:461
- Removing the LangChain test directory leaves
tests/TEST_PLAN.md:94listing the LangChain extension as an existing test target andtests/TEST_PLAN.md:122listing its full-flow integration as pending. Please update or explicitly retire those plan entries so the test documentation matches the supported workspace.
│ ├── openai/
- Files reviewed: 23/24 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -6,7 +6,6 @@ build-backend = "setuptools.build_meta" | |||
| members = [ | |||
| "libraries/microsoft-agents-a365-notifications", | |||
| "libraries/microsoft-agents-a365-observability-core", | |||
| │ ├── *-observability-extensions-openai | ||
| │ ├── *-observability-extensions-langchain | ||
| │ ├── *-observability-extensions-semantickernel | ||
| │ └── *-observability-extensions-agentframework |
| ``` | ||
| Agent365-python/ | ||
| ├── libraries/ # Core packages (13 total) | ||
| ├── libraries/ # Core packages (12 total) |
dbezic (dbezic)
left a comment
There was a problem hiding this comment.
This is a major change, we should verify this
Summary
Removes the LangChain observability extension package (
microsoft-agents-a365-observability-extensions-langchain) and its dependencies from this repository, following a security/policy review of the LangChain framework dependency.What changed
libraries/microsoft-agents-a365-observability-extensions-langchain/(source, tests, docs, changelog)tests/observability/extensions/langchain/[tool.uv.workspace] membersand[tool.uv.sources]in rootpyproject.tomllangchain-corefromconstraint-dependenciesandlangchain-openaifromdev-dependenciesin rootpyproject.tomlREADME.md,CLAUDE.md,DEPENDENCIES.md,docs/design.md, anddocs/integrating-with-existing-opentelemetry.mdto drop references to the removed packageuv.lockImpact analysis
What is removed from the dependency tree:
langchain-core,langchain-openai,langsmith, and their now-orphaned transitive subtree (jsonpatch,jsonpointer,orjson,regex,requests-toolbelt,tiktoken,uuid-utils,xxhash,zstandard). None of these packages are used anywhere else in this workspace — confirmed by searching every other package'spyproject.tomlfor a dependency on the removed package or onlangchain-coredirectly; there are none.What is NOT affected by this change:
uv build --all-packages --wheel).What this DOES break, and who is affected:
microsoft-agents-a365-observability-extensions-langchainis a currently published package (latest version 1.0.0, "Alpha" development status). For any existing consumer who installs it directly for LangChain tracing:Capabilities a consumer of this package loses (feature-level detail):
LangChainTracerInstrumentor().instrument()call hooked into LangChain's own callback system — consumers would otherwise need to hand-roll their own OpenTelemetry instrumentation for LangChainon_chain_start/on_chain_endcallbacks were mapped to Agent365'sInvokeAgentScope(chain inputs/outputs recorded as spans)on_llm_start/on_llm_endcallbacks were mapped toInferenceScope, including token usage tracking and finish-reason captureon_tool_start/on_tool_endcallbacks were mapped toExecuteToolScope, including tool call arguments and resultsHumanMessage/AIMessage/SystemMessage/ToolMessageobjects were converted into Agent365's standardInputMessages/OutputMessagesschema, so traces looked consistent across LangChain, OpenAI SDK, Semantic Kernel, and Agent Framework consumersNet effect: an affected consumer's LangChain application continues to run exactly as before (no functional/runtime change), but it goes dark from an Agent365 observability standpoint — no spans, no token/cost tracking, no chain/tool visibility in their telemetry backend — unless they build equivalent instrumentation themselves or adopt a third-party alternative (e.g., a community-maintained OpenTelemetry LangChain instrumentor).
Regression risk to the rest of the SDK: none, verified. Every other extension (OpenAI, Semantic Kernel, Agent Framework, Google ADK) and the core SDK/runtime/tooling packages are completely untouched by this change — confirmed by dependency search, a clean build of all 12 remaining packages, and a full test run showing zero unexplained failures (see Local verification below).
Local verification
uv lock/uv sync --locked --all-extras --dev: cleantox -e verify-constraints: PASStox -e lint: PASStox -e format: PASStox -e py312: 790 passed, 3 skipped, 5 deselected, 0 faileduv build --all-packages --wheel: all 12 remaining workspace packages build successfullyThis PR was generated by an AI assistant. Please review carefully before merging, particularly the customer-impact section above.