Skip to content

feat(copaw): add CoPaw instrumentation, LoongSuite CI, and bootstrap mapping#162

Merged
Cirilla-zmh merged 9 commits intoalibaba:mainfrom
Cirilla-zmh:feat/copaw
Apr 3, 2026
Merged

feat(copaw): add CoPaw instrumentation, LoongSuite CI, and bootstrap mapping#162
Cirilla-zmh merged 9 commits intoalibaba:mainfrom
Cirilla-zmh:feat/copaw

Conversation

@Cirilla-zmh
Copy link
Copy Markdown
Collaborator

Description

What changed

CoPaw instrumentation package

New package under instrumentation-loongsuite/loongsuite-instrumentation-copaw/: CoPawInstrumentor wraps CoPaw’s runner conversation path with ExtendedTelemetryHandler entry lifecycle (start_entry / stop_entry / fail_entry), builds EntryInvocation from request/session/channel and stream chunks (_entry_utils + patch.py), and records streaming gen_ai.response.time_to_first_token where applicable. Depends on opentelemetry-util-genai; forwards tracer_provider / meter_provider / logger_provider from instrument().

CI and tox

tox-loongsuite.ini: environments for py3{10,11,12,13}-test-loongsuite-instrumentation-copaw-{oldest,latest} and lint-loongsuite-instrumentation-copaw (lint intentionally does not merge copaw requirements.oldest with dev-requirements—documented resolver conflict). .github/workflows/loongsuite_test_0.yml and loongsuite_lint_0.yml regenerated so CI runs those tox targets.

Distro bootstrap

bootstrap_gen.py: adds copaw >= 0.1.0loongsuite-instrumentation-copaw mapping for loongsuite-bootstrap auto-install, and bumps pinned opentelemetry-instrumentation-* versions broadly to 0.62b0.dev for 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 toward tests/requirements.latest.txt / tests/requirements.oldest.txt and removes legacy test-requirements-*.txt roots—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.txt minor 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 and EntryInvocation helpers 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 + CoPawInstrumentor with GenAI stability opt-in.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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

  • Add integration tests

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

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: I4fa0e0a5a5a9d179d59bb8dd536ff8f1f76732dd
Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I82f811fac4c7a1665efd9f420545e187d4f27eb0
Co-developed-by: Cursor <noreply@cursor.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-copaw implementing Entry-span telemetry for AgentRunner.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.

Change-Id: I737fdd2812ecb26742175650a4ce76d2e880380e
Co-developed-by: Cursor <noreply@cursor.com>
@Cirilla-zmh Cirilla-zmh merged commit 41ce634 into alibaba:main Apr 3, 2026
107 checks passed
@Cirilla-zmh Cirilla-zmh added enhancement New feature or request instrumentaion The instrumentation label represents issues related to instrumentation. genai The genai label represents issues related to generative AI. labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request genai The genai label represents issues related to generative AI. instrumentaion The instrumentation label represents issues related to instrumentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants