Repository navigation
Add QwenPaw 2.x runtime support - #994
123liuziming wants to merge 10 commits into
Conversation
Assisted-by: GPT-6.1 Sol
Pull request dashboard statusWaiting 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): Status above doesn't look right?
|
Assisted-by: GPT-6.1 Sol
Assisted-by: GPT-6.1 Sol
Assisted-by: GPT-6.1 Sol
Assisted-by: GPT-6.1 Sol
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
There was a problem hiding this comment.
🟡 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
This comment has been minimized.
This comment has been minimized.
Assisted-by: GPT-6.1 Sol
Assisted-by: GPT-6.1 Sol
Assisted-by: GPT-6.1 Sol
There was a problem hiding this comment.
🟡 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
| if invocation.should_capture_content: | ||
| for message in _items(_field(chunk, "output")): | ||
| self._capture_message(message) |
| if self._self_complete: | ||
| invocation.finish_reasons = ["stop"] |
| class RuntimeMessagesScenario(Scenario): | ||
| expected_spans = {"invoke_agent": 1} | ||
| expected_metrics = ("gen_ai.invoke_agent.duration",) |
| stream = make_runtime_wrapper(handler)( | ||
| events, make_runtime(), (runtime_request(),), {} | ||
| ) |

Adds QwenPaw 2.x
Runtime.runinstrumentation while retaining 1.xAgentRunner.query_handlersupport. Captures request and streamed message content, preserves lazy execution, and propagates conversation IDs.Follow-up to #969.
Requires unreleased
opentelemetry-util-genai1.4b0. The error conformance scenario declares a known registry gap forgen_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.