feat(copaw): add CoPaw instrumentation, LoongSuite CI, and bootstrap mapping#162
Merged
Cirilla-zmh merged 9 commits intoalibaba:mainfrom Apr 3, 2026
Merged
feat(copaw): add CoPaw instrumentation, LoongSuite CI, and bootstrap mapping#162Cirilla-zmh merged 9 commits intoalibaba:mainfrom
Cirilla-zmh merged 9 commits intoalibaba:mainfrom
Conversation
Change-Id: I8d06200cd5339d346ab52a324936be397faf153d Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I8bdf89aaa10e11bc83905ef13a86d742ce129624 Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: Id69b2e64718a2fff833b65f7719392a459245745 Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: Id06932c4f84250a4eb9c7d9ad0737b738ce29fcb Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: Id97f3af859508e8e49cc70901642b3e566ca1e98 Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I6a1d48bee3a171ed0301d48b699edd2a04f8c7d5 Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I82f811fac4c7a1665efd9f420545e187d4f27eb0 Co-developed-by: Cursor <noreply@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new LoongSuite instrumentation package for CoPaw and wires it into LoongSuite’s CI/tox and distro bootstrap auto-install mapping, alongside a set of test-requirements reshuffles/standardization across existing instrumentations.
Changes:
- Introduce
loongsuite-instrumentation-copawimplementing Entry-span telemetry forAgentRunner.query_handler, plus tests and package metadata. - Extend
tox-loongsuite.ini+ GitHub Actions workflows to run CoPaw tests/lint in CI and realign some existing test-requirements paths (e.g., mem0). - Update distro bootstrap mapping (
bootstrap_gen.py) to include CoPaw and bump pinned instrumentation versions; update docs/README listings accordingly.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tox-loongsuite.ini | Adds CoPaw test/lint envs and updates some dependency file paths (notably mem0). |
| README.md | Lists CoPaw instrumentation; adds extra blank lines near the bottom. |
| README-zh.md | Lists CoPaw instrumentation in the Chinese README. |
| loongsuite-distro/src/loongsuite/distro/bootstrap_gen.py | Adds CoPaw mapping and bumps pinned instrumentation versions across bootstrap mappings. |
| instrumentation-loongsuite/README.md | Adds CoPaw (and other newer packages) to instrumentation package index. |
| instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/requirements.oldest.txt | New “oldest” test requirements file under tests/. |
| instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/requirements.latest.txt | New “latest” test requirements file under tests/ with non-hermetic warning. |
| instrumentation-loongsuite/loongsuite-instrumentation-mem0/test-requirements-oldest.txt | Removes legacy root-level oldest requirements file. |
| instrumentation-loongsuite/loongsuite-instrumentation-mem0/test-requirements-latest.txt | Removes legacy root-level latest requirements file. |
| instrumentation-loongsuite/loongsuite-instrumentation-litellm/tests/test-requirements.txt | Minor documentation/comment tweak. |
| instrumentation-loongsuite/loongsuite-instrumentation-langgraph/tests/requirements.oldest.txt | Adds license header + clarifies “oldest” requirements intent. |
| instrumentation-loongsuite/loongsuite-instrumentation-langgraph/tests/requirements.latest.txt | Adds license header + non-hermetic warning text. |
| instrumentation-loongsuite/loongsuite-instrumentation-google-adk/tests/requirements.oldest.txt | Adds license header + clarifies “oldest” requirements intent. |
| instrumentation-loongsuite/loongsuite-instrumentation-google-adk/tests/requirements.latest.txt | Adds license header + non-hermetic warning text. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/tests/test_instrument_smoke.py | Smoke tests for instrument/uninstrument and a minimal query path. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/tests/test_entry_utils.py | Unit tests for argument parsing and EntryInvocation helpers. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/tests/test_entry_span.py | Integration-style test asserting Entry span attributes and TTFT. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/tests/requirements.txt | Test environment requirements for CoPaw instrumentation tests. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/tests/conftest.py | Pytest fixtures for tracer/span exporter and instrumentation setup. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/version.py | Defines package version. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/patch.py | Implements the query_handler wrapper that drives Entry telemetry. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/package.py | Declares instrumentation dependency metadata. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/_entry_utils.py | Utilities to build EntryInvocation and map messages/chunks. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/init.py | Adds CoPawInstrumentor wiring wrapt patches to the handler. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/README.md | Usage documentation (site-bootstrap recommended approach) and scope/attributes. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/pyproject.toml | New package metadata, deps, and entry point registration. |
| instrumentation-loongsuite/loongsuite-instrumentation-copaw/CHANGELOG.md | Initial changelog for the new package. |
| instrumentation-loongsuite/loongsuite-instrumentation-claude-agent-sdk/tests/requirements.latest.txt | Adds non-hermetic warning/commentary section. |
| instrumentation-loongsuite/loongsuite-instrumentation-agentscope/tests/requirements.oldest.txt | Adds license header + clarifies “oldest” requirements intent. |
| instrumentation-loongsuite/loongsuite-instrumentation-agentscope/tests/requirements.latest.txt | Adds license header + non-hermetic warning text. |
| dev-requirements.txt | Loosens requests pin to >= with a comment about CoPaw. |
| .github/workflows/loongsuite_test_0.yml | Adds CI jobs to run CoPaw tests across Python 3.10–3.13. |
| .github/workflows/loongsuite_lint_0.yml | Adds CI job to run CoPaw lint target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
instrumentation-loongsuite/loongsuite-instrumentation-copaw/pyproject.toml
Show resolved
Hide resolved
...loongsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/patch.py
Outdated
Show resolved
Hide resolved
...ngsuite/loongsuite-instrumentation-copaw/src/opentelemetry/instrumentation/copaw/__init__.py
Show resolved
Hide resolved
123liuziming
approved these changes
Apr 3, 2026
sipercai
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What changed
CoPaw instrumentation package
New package under
instrumentation-loongsuite/loongsuite-instrumentation-copaw/:CoPawInstrumentorwraps CoPaw’s runner conversation path withExtendedTelemetryHandlerentry lifecycle (start_entry/stop_entry/fail_entry), buildsEntryInvocationfrom request/session/channel and stream chunks (_entry_utils+patch.py), and records streaminggen_ai.response.time_to_first_tokenwhere applicable. Depends onopentelemetry-util-genai; forwardstracer_provider/meter_provider/logger_providerfrominstrument().CI and tox
tox-loongsuite.ini: environments forpy3{10,11,12,13}-test-loongsuite-instrumentation-copaw-{oldest,latest}andlint-loongsuite-instrumentation-copaw(lint intentionally does not merge copawrequirements.oldestwithdev-requirements—documented resolver conflict)..github/workflows/loongsuite_test_0.ymlandloongsuite_lint_0.ymlregenerated so CI runs those tox targets.Distro bootstrap
bootstrap_gen.py: addscopaw >= 0.1.0→loongsuite-instrumentation-copawmapping forloongsuite-bootstrapauto-install, and bumps pinnedopentelemetry-instrumentation-*versions broadly to0.62b0.devfor consistency with the current contrib line.Cross-package test requirements & mem0 layout
Tightens or realigns
requirements.latest.txt/requirements.oldest.txt(and related pins) for Agentscope, Claude Agent SDK, Google ADK, Langgraph, LiteLLM tests. mem0: moves towardtests/requirements.latest.txt/tests/requirements.oldest.txtand removes legacytest-requirements-*.txtroots—keeps tox env wiring in sync with other packages.Documentation & housekeeping
README for the CoPaw package (Getting Started with Site-bootstrap, what is instrumented). CHANGELOG trimmed for release notes style. instrumentation-loongsuite/README.md lists the new package;
dev-requirements.txtminor bump.Tests
instrumentation-loongsuite/loongsuite-instrumentation-copaw/tests/test_entry_span.py— real CoPaw + monkeypatched approval path; asserts Entry span name, operation, kind, session/user, copaw attributes, TTFT.tests/test_entry_utils.py— parsing andEntryInvocationhelpers without full app.tests/test_instrument_smoke.py— instrument/uninstrument round-trip and log/smoke path with a single finished span.tests/conftest.py— exporter +CoPawInstrumentorwith GenAI stability opt-in.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.