Skip to content

Releases: alibaba/loongsuite-python-agent

loongsuite-python-agent 0.3.0

27 Mar 02:43
257b7f1

Choose a tag to compare

loongsuite-python-agent 0.3.0

Installation

pip install loongsuite-distro==0.3.0
loongsuite-bootstrap -a install --version 0.3.0

Package Versions

  • loongsuite-* packages: 0.3.0
  • opentelemetry-* packages: 0.61b0

PyPI packages

The following distributions are built and uploaded to PyPI for this release:

  • loongsuite-util-genai
  • loongsuite-distro
  • loongsuite-site-bootstrap
  • loongsuite-instrumentation-agentscope
  • loongsuite-instrumentation-claude-agent-sdk
  • loongsuite-instrumentation-crewai
  • loongsuite-instrumentation-dashscope
  • loongsuite-instrumentation-google-adk
  • loongsuite-instrumentation-langchain
  • loongsuite-instrumentation-langgraph
  • loongsuite-instrumentation-litellm
  • loongsuite-instrumentation-mem0

loongsuite

Added

  • Release tooling: build and publish instrumentation-loongsuite/* as separate PyPI wheels (with loongsuite_pypi_manifest.py defining which distributions are uploaded; some remain tar-only until ready), and add a PyPI packages section to aggregated release notes (#155)
  • loongsuite-site-bootstrap: initialize .pth-based OTel auto-instrumentation package (#156)
  • Top-level docs: add Chinese README (README-zh.md) translated from README.md. (#159)

Changed

  • instrumentation-loongsuite/*, loongsuite-distro, and util/opentelemetry-util-genai: pyproject.toml metadata and dependencies for standalone PyPI installs (#155)
  • loongsuite-site-bootstrap, loongsuite-distro docs: update README.md. (#159)

loongsuite-util-genai

Breaking Change

  • Remove package opentelemetry.util.genai._extended_common. EntryInvocation and ReactStepInvocation now live in extended_types; _apply_entry_finish_attributes and _apply_react_step_finish_attributes live in extended_span_utils. (#158)
  • Rename packages opentelemetry.util.genai._extended_memoryextended_memory and opentelemetry.util.genai._extended_semconvextended_semconv (public module paths). (#158)

Fixed

  • Add bypass logic around instrumentation-specific initialization so opentelemetry-util-genai can work correctly as a standalone SDK without depending on instrumentation package bootstrap flow. (#159)

loongsuite-instrumentation-agentscope

Changed

  • Adapt imports to opentelemetry-util-genai module layout change (#158)

Fixed

  • Avoid duplicate LLM / Agent spans when multiple ChatModelBase or
    AgentBase subclasses stack (e.g. proxy layers that each implement __call__
    and forward inward), by tracking per-task __call__ depth with
    contextvars and only instrumenting the outermost frame (#153)
  • Avoid duplicate react step spans when ReAct hook wrappers nest (e.g.
    subclasses or mixins that override _reasoning / _acting and call
    super()), by only opening steps and updating tool-act counts on the
    outermost wrapper (#153)

Changed

  • Update README integration flow to align with the root recommended LoongSuite pattern using Option C (pip install loongsuite-instrumentation-agentscope) and loongsuite-instrument. (#159)

Added

  • Add ReAct step span instrumentation for ReAct agents (#140)
    • Each ReAct iteration is wrapped in a react step span with gen_ai.react.round and gen_ai.react.finish_reason attributes
    • Uses AgentScope's instance-level hook system for robust, non-invasive instrumentation

loongsuite-instrumentation-agno

Changed

  • Update README integration flow to align with the root recommended LoongSuite pattern using Option A (loongsuite-bootstrap -a install --latest) for this package not yet on PyPI. (#159)

loongsuite-instrumentation-claude-agent-sdk

Changed

  • Adapt imports to opentelemetry-util-genai module layout change (#158)

loongsuite-instrumentation-crewai

Changed

  • Adapt imports to opentelemetry-util-genai module layout change (#158)
  • Update README integration flow to align with the root recommended LoongSuite pattern using Option C (pip install loongsuite-instrumentation-crewai) and loongsuite-instrument. (#159)

Added

  • Initialize the instrumentation for CrewAI (#87)

loongsuite-instrumentation-dashscope

Changed

  • Adapt imports to opentelemetry-util-genai module layout change (#158)

loongsuite-instrumentation-dify

Changed

  • Update README integration flow to align with the root recommended LoongSuite pattern using Option A (loongsuite-bootstrap -a install --latest) for this package not yet on PyPI. (#159)

loongsuite-instrumentation-google-adk

Changed

  • Update README integration flow to align with the root recommended LoongSuite pattern using Option C (pip install loongsuite-instrumentation-google-adk) and loongsuite-instrument. (#159)

loongsuite-instrumentation-langchain

Added

  • Rerank / document-compressor span support (#149)

Changed

  • Adapt imports to opentelemetry-util-genai module layout change (#158)
  • Set run_inline = True on the tracer so LangChain callbacks run inline for correct OpenTelemetry context propagation (#148)
  • Improved token usage extraction to support multiple LangChain/LLM provider formats (#148)
  • Update README integration flow to align with the root recommended LoongSuite pattern using Option C (pip install loongsuite-instrumentation-langchain) and loongsuite-instrument. (#159)

loongsuite-instrumentation-langgraph

Changed

  • Update README integration flow to align with the root recommended LoongSuite pattern using Option C (pip install loongsuite-instrumentation-langgraph) and loongsuite-instrument. (#159)

loongsuite-instrumentation-mcp

Changed

  • Update README integration flow to align with the root recommended LoongSuite pattern using Option A (loongsuite-bootstrap -a install --latest) for this package not yet on PyPI. (#159)

loongsuite-instrumentation-mem0

Changed

  • Adapt imports to opentelemetry-util-genai module layout change (#158)
  • Update README integration flow to align with the root recommended LoongSuite pattern using Option C (pip install loongsuite-instrumentation-mem0) and loongsuite-instrument. (#159)

loongsuite-python-agent 0.2.0

12 Mar 09:41
33fb2d6

Choose a tag to compare

loongsuite-python-agent 0.2.0

Installation

pip install loongsuite-distro==0.2.0
loongsuite-bootstrap -a install --version 0.2.0

Package Versions

  • loongsuite-* packages: 0.2.0
  • opentelemetry-* packages: 0.61b0

loongsuite-util-genai

Added

  • Add RetrievalDocument dataclass for typed retrieval document representation (id, score, content, metadata). (#145)
  • Control RetrievalDocument serialization: when content capturing is NO_CONTENT, only serialize id and score; when SPAN_ONLY/SPAN_AND_EVENT, serialize full (id, score, content, metadata) (#145)
  • Add Entry span (gen_ai.span.kind=ENTRY) and ReAct Step span (gen_ai.span.kind=STEP) support in ExtendedTelemetryHandler with types, utilities, and context-manager APIs (#135)
  • Propagate gen_ai.session.id and gen_ai.user.id into Baggage during start_entry, enabling traffic coloring via BaggageSpanProcessor for all child spans within the entry block (#135)

Changed

  • Retrieval semantic convention: Align retrieval spans with LoongSuite spec (#145)
    • gen_ai.operation.name: retrieve_documentsretrieval
    • gen_ai.retrieval.querygen_ai.retrieval.query.text for query text
    • Span name: retrieval {gen_ai.data_source.id} when data_source_id is set
    • Add RetrievalInvocation fields: data_source_id, provider, request_model, top_k
  • Add optional context parameter to all start_* methods in TelemetryHandler and ExtendedTelemetryHandler for explicit parent-child span linking (#135)
  • Unify attach/detach strategy in ExtendedTelemetryHandler: always attach regardless of whether context is provided; stop_*/fail_* guards restored to context_token is None or span is None (#135)

Fixed

  • Fix gen_ai.retrieval.query to respect content capturing mode: when OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT is NO_CONTENT, both query and documents are now omitted from retrieve spans (previously only documents were gated) (#139)
  • Fix _safe_detach to use _RUNTIME_CONTEXT.detach directly, avoiding noisy ERROR log from OTel SDK's context_api.detach wrapper (#135)
  • Fix undefined otel_context reference in _multimodal_processing.py process_multimodal_fail, replaced with _safe_detach (#135)

loongsuite-instrumentation-langchain

Added

  • ReAct Step instrumentation for AgentExecutor (#139)

    • Monkey-patch AgentExecutor._iter_next_step and _aiter_next_step to instrument each ReAct iteration
    • Dual patch: patch both langchain.agents (0.x) and langchain_classic.agents (1.x) when available, so either import path works
    • Covers invoke, ainvoke, stream, astream, batch, abatch
    • ReAct Step spans: gen_ai.span.kind=STEP, gen_ai.operation.name=react, gen_ai.react.round, gen_ai.react.finish_reason
    • Span hierarchy: Agent > ReAct Step > LLM/Tool
  • LangGraph ReAct agent support (requires loongsuite-instrumentation-langgraph) (#139)

    • Detect LangGraph agents via Run.metadata["_loongsuite_react_agent"]
      (metadata injected by the LangGraph instrumentation)
    • Disambiguate the top-level graph (Agent span) from child nodes (chain
      spans) using inside_langgraph_react propagation
    • Agent name resolution: when the ReAct agent is invoked inside an outer
      graph node, inherit the node's name (e.g. invoke_agent product_agent)
      instead of the generic default (invoke_agent LangGraph)
    • Track ReAct step boundaries via callback-based detection of the
      "agent" node within the graph
    • Span hierarchy: Agent > ReAct Step > LLM/Tool (same as AgentExecutor)

Breaking Changes

  • Rewrite the instrumentation for LangChain with genai-util (#139)
    • Replaced the legacy wrapt-based function wrapping with BaseTracer callback mechanism
    • Migrated to ExtendedTelemetryHandler from opentelemetry-util-genai for standardized GenAI semantic conventions
    • Added Agent detection by run.name, TTFT tracking, content capture gating, and RLock thread safety
    • Added new test suite with oldest/latest dependency matrices

loongsuite-instrumentation-langgraph

Added

  • Initial instrumentation framework for LangGraph (#143)
    • Patch create_react_agent to set _loongsuite_react_agent = True flag
      on CompiledStateGraph
    • Patch Pregel.stream / Pregel.astream to inject
      metadata["_loongsuite_react_agent"] into RunnableConfig, enabling
      LangChain instrumentation to detect ReAct agents via callback metadata
    • All patches use wrapt.wrap_function_wrapper /
      opentelemetry.instrumentation.utils.unwrap (consistent with
      loongsuite-instrumentation-langchain)

loongsuite-instrumentation-litellm

Added

  • Initialize the instrumentation for Litellm (#88)

loongsuite-python-agent 0.1.0

28 Feb 08:15
ebedcb1

Choose a tag to compare

loongsuite-python-agent 0.1.0

Installation

pip install loongsuite-distro==0.1.0
loongsuite-bootstrap -a install --version 0.1.0

Package Versions

  • loongsuite-* packages: 0.1.0
  • opentelemetry-* packages: 0.60b1

loongsuite

Fixed

  • Add from __future__ import annotations to fix Python 3.9 compatibility for union type syntax (X | Y) (#80)

Added

  • loongsuite-distro: initialize loongsuite python agent distro (#126)

loongsuite-util-genai

Fixed

  • Fix compatibility with Python 3.8 hashlib usage (#102)

Added

  • Add support for memory operations (#83)
  • Add multimodal separation and upload support for GenAI utils (#94)
  • Add gen_ai.usage.total_tokens attribute for LLM, Agent, and Embedding operations (#108)
  • Add gen_ai.response.time_to_first_token attribute for LLM operations (#113)
  • Enhance the capture and upload process of multimodal data (#119)
    • Enhance multimodal pre-upload pipeline with Data URI and local path support
    • Add AgentInvocation multimodal data handling
    • Introduce configurable pre-upload hooks and uploader entry points, add graceful shutdown processor for GenAI components
    • Improve multimodal metadata extraction and docs

loongsuite-instrumentation-agentscope

Fixed

  • Fix tool call response parsing (#118)
  • Fix LLM message content capture in spans (#91)
  • Fix spell mistake in pyproject.toml (#8)

Breaking Changes

  • Deprecate the support for AgentScope v0 (#82)

Changed

  • Refactor the instrumentation for AgentScope with genai-util (#82)
    • Refactored to use opentelemetry-util-genai: Migrated to ExtendedTelemetryHandler and ExtendedInvocationMetricsRecorder from opentelemetry-util-genai for unified metrics and tracing management
    • Architecture Simplification: Removed redundant code and consolidated instrumentation logic
    • Tool Tracing Enhancement: Rewritten tool execution tracing to use ExtendedTelemetryHandler for full feature support (see HANDLER_INTEGRATION.md)
      • Now properly leverages _apply_execute_tool_finish_attributes for standardized attribute handling
      • Automatic metrics recording for tool executions
      • Content capturing mode support (respects experimental mode and content capturing settings)
      • Unified error handling with proper error attributes
    • Removed "V1" prefix from class names (AgentScopeV1ChatModelWrapper → AgentScopeChatModelWrapper, etc.)
    • Updated to use Apache License 2.0 headers across all source files
  • Refactor the instrumentation for AgentScope (#14)

Added

  • Add support for agentscope v1.0.0 (#45)
  • Initialize the instrumentation for AgentScope (#2)

loongsuite-instrumentation-agno

Fixed

  • Fix aresponse missing await and double wrapped() calls (#107)
  • Fix broken trace caused by the improper setting of the parent context (#23)
  • Correct span name of tool call (#21)

Added

  • Initial implementation of Agno instrumentation (#13)

loongsuite-instrumentation-claude-agent-sdk

Added

  • Initial implementation of Claude Agent SDK instrumentation (#104)
    • Support for agent query sessions via Hooks mechanism
    • Support for tool execution tracing (PreToolUse/PostToolUse hooks)
    • Integration with opentelemetry-util-genai ExtendedTelemetryHandler
    • Span attributes following OpenTelemetry GenAI Semantic Conventions
    • Support for Alibaba Cloud DashScope Anthropic-compatible API

loongsuite-instrumentation-dashscope

Added

  • Add support for multimodal API (#111)
  • Initial implementation of DashScope instrumentation (#66)

Fixed

  • Fix MIME type inference logic for speech synthesis instrumentation (#115)

loongsuite-instrumentation-dify

Fixed

  • Correct timestamp calculation in dify instrumentation (#74)

Added

  • Initialize the instrumentation for dify (#29)

loongsuite-instrumentation-google-adk

Added

  • Initialize the instrumentation for Google Agent Development Kit (ADK) (#71)

loongsuite-instrumentation-langchain

Added

  • Initialize the instrumentation for langchain (#34)

loongsuite-instrumentation-mcp

Fixed

  • Add support for mcp 1.25.0 (#126)

Added

  • Add quick start document for mcp (#43)
  • Initialize the instrumentation for mcp (#12)

Changed

  • Relocate mcp instrumentation to loongsuite directory (#42)
  • Refactor the instrumentation for mcp (#39)

loongsuite-instrumentation-mem0

Fixed

  • Fix unit tests (#98)

Added

  • Refactor capture logic with memory handler (#89)
  • Add hook extensions (#95)
  • Initialize the instrumentation for mem0 (#67)