Skip to content

Remove LangChain observability extension and its dependencies - #274

Open
EvanderDS (EvanderDS) wants to merge 1 commit into
microsoft:mainfrom
EvanderDS:s360-remove/langchain-mvs-2023-gwm8-m3c2
Open

Remove LangChain observability extension and its dependencies#274
EvanderDS (EvanderDS) wants to merge 1 commit into
microsoft:mainfrom
EvanderDS:s360-remove/langchain-mvs-2023-gwm8-m3c2

Conversation

@EvanderDS

@EvanderDS EvanderDS (EvanderDS) commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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

  • Deleted libraries/microsoft-agents-a365-observability-extensions-langchain/ (source, tests, docs, changelog)
  • Deleted tests/observability/extensions/langchain/
  • Removed the package from [tool.uv.workspace] members and [tool.uv.sources] in root pyproject.toml
  • Removed langchain-core from constraint-dependencies and langchain-openai from dev-dependencies in root pyproject.toml
  • Updated README.md, CLAUDE.md, DEPENDENCIES.md, docs/design.md, and docs/integrating-with-existing-opentelemetry.md to drop references to the removed package
  • Regenerated uv.lock

Impact 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's pyproject.toml for a dependency on the removed package or on langchain-core directly; there are none.

What is NOT affected by this change:

  • No other workspace package (OpenAI, Semantic Kernel, Agent Framework, Google ADK extensions; core SDK/runtime/tooling) depends on the removed package or on LangChain.
  • All 12 remaining workspace packages build successfully (uv build --all-packages --wheel).
  • Full test suite passes: 790 passed, 0 failed. (Down from 800 before this change — the 10 fewer tests are exactly the removed package's own test suite, not incidental breakage elsewhere.)

What this DOES break, and who is affected:

  • microsoft-agents-a365-observability-extensions-langchain is a currently published package (latest version 1.0.0, "Alpha" development status). For any existing consumer who installs it directly for LangChain tracing:
    • Already-installed versions continue to work as-is — this PR does not retract or modify anything already published; that would be a separate, deliberate action if ever needed.
    • No further releases (bug fixes, security patches, or features) will be published for this package once this merges — the last published version becomes permanently frozen going forward.
    • Anyone building this monorepo from source will no longer have this package available at all.
  • Any published documentation that references this package/feature will need a separate, out-of-band update — out of scope for this code change.
  • No impact to any other Agent 365 SDK package, extension, or consumer — this is an isolated, opt-in extension with no other in-repo dependents.

Capabilities a consumer of this package loses (feature-level detail):

Capability Detail
Automatic instrumentation A single LangChainTracerInstrumentor().instrument() call hooked into LangChain's own callback system — consumers would otherwise need to hand-roll their own OpenTelemetry instrumentation for LangChain
Chain execution tracing on_chain_start / on_chain_end callbacks were mapped to Agent365's InvokeAgentScope (chain inputs/outputs recorded as spans)
LLM call tracing on_llm_start / on_llm_end callbacks were mapped to InferenceScope, including token usage tracking and finish-reason capture
Tool execution tracing on_tool_start / on_tool_end callbacks were mapped to ExecuteToolScope, including tool call arguments and results
Message-format normalization LangChain's HumanMessage / AIMessage / SystemMessage / ToolMessage objects were converted into Agent365's standard InputMessages / OutputMessages schema, so traces looked consistent across LangChain, OpenAI SDK, Semantic Kernel, and Agent Framework consumers
Bounded/truncated span export Dedicated logic existed to bound trace payload size on export — a consumer building equivalent instrumentation themselves would need to reimplement this safeguard

Net 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: 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
  • uv build --all-packages --wheel: all 12 remaining workspace packages build successfully

This PR was generated by an AI assistant. Please review carefully before merging, particularly the customer-impact section above.

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>
Copilot AI lite review requested due to automatic review settings September 11, 2026 15:34
@EvanderDS

Copy link
Copy Markdown
Contributor Author

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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:94 listing the LangChain extension as an existing test target and tests/TEST_PLAN.md:122 listing 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.

Comment thread pyproject.toml
@@ -6,7 +6,6 @@ build-backend = "setuptools.build_meta"
members = [
"libraries/microsoft-agents-a365-notifications",
"libraries/microsoft-agents-a365-observability-core",
Comment thread CLAUDE.md
Comment on lines 126 to 128
│ ├── *-observability-extensions-openai
│ ├── *-observability-extensions-langchain
│ ├── *-observability-extensions-semantickernel
│ └── *-observability-extensions-agentframework
Comment thread docs/design.md
```
Agent365-python/
├── libraries/ # Core packages (13 total)
├── libraries/ # Core packages (12 total)

@dbezic dbezic (dbezic) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a major change, we should verify this

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.

4 participants