Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/loongsuite_lint_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ jobs:
- name: Run tests
run: tox -c tox-loongsuite.ini -e lint-loongsuite-instrumentation-google-adk

lint-loongsuite-instrumentation-langchain:
name: LoongSuite loongsuite-instrumentation-langchain
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e lint-loongsuite-instrumentation-langchain

lint-loongsuite-instrumentation-mem0:
name: LoongSuite loongsuite-instrumentation-mem0
runs-on: ubuntu-latest
Expand Down
190 changes: 190 additions & 0 deletions .github/workflows/loongsuite_test_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,196 @@ jobs:
- name: Run tests
run: tox -c tox-loongsuite.ini -e py313-test-loongsuite-instrumentation-google-adk-latest -- -ra

py39-test-loongsuite-instrumentation-langchain-oldest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-oldest 3.9 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py39-test-loongsuite-instrumentation-langchain-oldest -- -ra

py39-test-loongsuite-instrumentation-langchain-latest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-latest 3.9 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py39-test-loongsuite-instrumentation-langchain-latest -- -ra

py310-test-loongsuite-instrumentation-langchain-oldest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-oldest 3.10 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py310-test-loongsuite-instrumentation-langchain-oldest -- -ra

py310-test-loongsuite-instrumentation-langchain-latest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-latest 3.10 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py310-test-loongsuite-instrumentation-langchain-latest -- -ra

py311-test-loongsuite-instrumentation-langchain-oldest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-oldest 3.11 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py311-test-loongsuite-instrumentation-langchain-oldest -- -ra

py311-test-loongsuite-instrumentation-langchain-latest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-latest 3.11 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py311-test-loongsuite-instrumentation-langchain-latest -- -ra

py312-test-loongsuite-instrumentation-langchain-oldest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-oldest 3.12 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py312-test-loongsuite-instrumentation-langchain-oldest -- -ra

py312-test-loongsuite-instrumentation-langchain-latest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-latest 3.12 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py312-test-loongsuite-instrumentation-langchain-latest -- -ra

py313-test-loongsuite-instrumentation-langchain-oldest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-oldest 3.13 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py313-test-loongsuite-instrumentation-langchain-oldest -- -ra

py313-test-loongsuite-instrumentation-langchain-latest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-langchain-latest 3.13 Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install tox
run: pip install tox-uv

- name: Run tests
run: tox -c tox-loongsuite.ini -e py313-test-loongsuite-instrumentation-langchain-latest -- -ra

py310-test-loongsuite-instrumentation-mem0-oldest_ubuntu-latest:
name: LoongSuite loongsuite-instrumentation-mem0-oldest 3.10 Ubuntu
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- ReAct Step instrumentation for AgentExecutor
([#139](https://github.com/alibaba/loongsuite-python-agent/pull/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](https://github.com/alibaba/loongsuite-python-agent/pull/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](https://github.com/alibaba/loongsuite-python-agent/pull/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

## Version 0.1.0 (2026-02-28)

### Added
Expand Down
Loading