Skip to content

Add QwenPaw 2.x runtime support - #994

Open
123liuziming wants to merge 10 commits into
open-telemetry:mainfrom
123liuziming:codex/qwenpaw-2x-support
Open

123liuziming wants to merge 10 commits into
open-telemetry:mainfrom
123liuziming:codex/qwenpaw-2x-support

Conversation

@123liuziming

@123liuziming 123liuziming commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds QwenPaw 2.x Runtime.run instrumentation while retaining 1.x AgentRunner.query_handler support. Captures request and streamed message content, preserves lazy execution, and propagates conversation IDs.

Follow-up to #969.

Requires unreleased opentelemetry-util-genai 1.4b0. The error conformance scenario declares a known registry gap for gen_ai.invoke_agent.exception, which the util emits but the pinned semantic-conventions registry does not define. The declaration fails once the gap disappears.

Validated the unit suites and all 10 Weaver conformance scenarios across QwenPaw 1.1.0, 1.1.12.post3, 2.0.0, and 2.2.2.post1. Pre-commit, README rendering, and type checking pass.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-11-11 19:36 UTC

Respond to 4 review items (e.g. link a commit, explain why not, ask a follow-up):

  • Inline threads: 1, 2, 3, 4
Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

Retain hook context across stream reads, merge partial message snapshots, and use shared media conversion. Cover both runtime generations and keep fixture-specific assertions in unit tests.

Assisted-by: GPT-6.1 Sol
@123liuziming 123liuziming changed the title [WIP] Add QwenPaw 2.x runtime support Add QwenPaw 2.x runtime support Nov 1, 2026
@123liuziming
123liuziming marked this pull request as ready for review November 1, 2026 09:34
Copilot AI balanced review requested due to automatic review settings November 1, 2026 09:34
@123liuziming
123liuziming requested a review from a team as a code owner November 1, 2026 09:34

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

Snapshot capture overwrites valid media content when text and media block indexes collide, causing finished spans and completion hooks to lose content.

1 open issue
What changed in this PR

Extends the existing QwenPaw instrumentation to support the 2.x Runtime.run entry point while retaining 1.x runner support.

Changes:

  • Adds lazy runtime tracing, conversation propagation, and streamed message capture.
  • Expands unit and conformance coverage across both runtime generations.
  • Updates dependency ranges, examples, and documentation for 2.x support.

Paths below are relative to instrumentation/opentelemetry-instrumentation-genai-qwenpaw/, except those marked repository root.

File Description
uv.lock (repository root) Updates the supported QwenPaw range.
tox.ini (repository root) Adds version-specific test environments and shared dependency constraints.
README.md (repository root) Updates the instrumentation compatibility table.
tests/​test_runtime.py Tests runtime tracing, lifecycle, context, and message capture.
tests/​test_message_mapping.py Uses structured user-message content.
tests/​test_instrumentor.py Adjusts dependency and instrumentation lifecycle tests.
tests/​test_instrumentation_scope.py Removes the legacy-runner fixture requirement.
tests/​test_conformance.py Registers error and rich-message scenarios.
tests/​requirements.v2.txt Adds the QwenPaw 2.0.0 test dependencies.
tests/​requirements.v1.txt Adds latest-1.x test dependencies.
tests/​requirements.oldest.txt Uses the unreleased workspace utility package.
tests/​requirements.latest.txt Moves latest-version testing to QwenPaw 2.x.
tests/​harness.py Adds runtime and request construction helpers.
tests/​conftest.py Selects fixtures by runtime generation.
tests/​conformance/​runtime_messages.py Exercises rich messages through runtime envelopes.
tests/​conformance/​runtime_error.py Exercises failed turns in both generations.
tests/​conformance/​invoke_agent.py Supports successful turns in both generations.
src/​opentelemetry/​instrumentation/​genai/​qwenpaw/​runtime.py Implements lazy runtime tracing and envelope capture.
src/​opentelemetry/​instrumentation/​genai/​qwenpaw/​package.py Broadens declared QwenPaw compatibility.
src/​opentelemetry/​instrumentation/​genai/​qwenpaw/​__init__.py Selects and unwraps version-specific instrumentation.
README.rst Documents runtime support, captured content, and test environments.
pyproject.toml Broadens QwenPaw support and raises the utility dependency floor.
examples/​zero-code/​requirements.txt Updates automatic-instrumentation examples to 2.x.
examples/​manual/​requirements.txt Updates manual-instrumentation examples to 2.x.
.changelog/​994.added Records added 2.x support and retained 1.x compatibility.

Review effort: Balanced

Distinguish text and media block indexes and preserve snapshot ordering without dropping unfinished content. Cover complete, early-close, and failed streams using real QwenPaw envelopes.

Assisted-by: GPT-6.1 Sol
@lmolkova lmolkova mentioned this pull request Nov 3, 2026
1 task
@opentelemetry-pr-dashboard

This comment has been minimized.

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

Heartbeat handling repeatedly decodes unchanged output and completion handling synthesizes unsupported finish reasons, while rich-content tests lack required coverage assertions and public-entry-point verification.

4 open issues
1 resolved since last review

Review effort: Balanced

Comment on lines +249 to +251
if invocation.should_capture_content:
for message in _items(_field(chunk, "output")):
self._capture_message(message)
Comment on lines +328 to +329
if self._self_complete:
invocation.finish_reasons = ["stop"]
Comment on lines +25 to +27
class RuntimeMessagesScenario(Scenario):
expected_spans = {"invoke_agent": 1}
expected_metrics = ("gen_ai.invoke_agent.duration",)
Comment on lines +903 to +905
stream = make_runtime_wrapper(handler)(
events, make_runtime(), (runtime_request(),), {}
)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants