Problem
loongsuite-instrumentation-agentscope currently declares agentscope >= 1.0.0 without an upper bound. AgentScope has released 2.0.0 with Requires-Python >=3.11, so py311+ latest installs can resolve to v2 even though the current instrumentation targets v1 APIs.
The current instrumentation wraps v1 symbols such as agentscope.agent.AgentBase, ReActAgent hooks, Toolkit.call_tool_function, TruncatedFormatterBase, and agentscope.tracing.*. AgentScope v2 uses agentscope.agent.Agent, reply/reply_stream, middleware hooks, Toolkit.call_tool, and agentscope.middleware._tracing.TracingMiddleware; the top-level agentscope.tracing package is no longer present.
Current tests also import v1-only APIs, including agentscope.tracing._trace, so v2 can fail at import time or miss instrumentation coverage.
Proposed Scope
- Short-term: cap the existing v1 instrumentation to
agentscope >=1,<2 in package metadata and test requirements.
- Add explicit test factors for AgentScope v1 and v2. v2 should run only on Python 3.11+.
- Design v2 support as a middleware-first implementation instead of reusing v1 monkey patches directly.
- Reuse
opentelemetry-util-genai / ExtendedTelemetryHandler for LLM, agent, tool, embedding, content, token, error, TTFT, metrics, and ReActStep behavior. Framework-local code should only adapt AgentScope v2 objects and lifecycle hooks.
- Evaluate duplicate-span behavior when users also enable AgentScope v2 native
TracingMiddleware.
Suggested v2 Contract Tests
- import smoke without
agentscope.tracing
- agent reply/reply_stream span tree
- model call span attributes and token usage where available
- tool call spans and tool error handling
- content capture disabled/span/event modes
- error status and exception attributes
- ReAct reasoning/action step mapping if supported by stable v2 events
- concurrent agents/state isolation
- uninstrument restore
- coexistence with native
TracingMiddleware without duplicate LoongSuite spans
Problem
loongsuite-instrumentation-agentscopecurrently declaresagentscope >= 1.0.0without an upper bound. AgentScope has released2.0.0withRequires-Python >=3.11, so py311+ latest installs can resolve to v2 even though the current instrumentation targets v1 APIs.The current instrumentation wraps v1 symbols such as
agentscope.agent.AgentBase,ReActAgenthooks,Toolkit.call_tool_function,TruncatedFormatterBase, andagentscope.tracing.*. AgentScope v2 usesagentscope.agent.Agent,reply/reply_stream, middleware hooks,Toolkit.call_tool, andagentscope.middleware._tracing.TracingMiddleware; the top-levelagentscope.tracingpackage is no longer present.Current tests also import v1-only APIs, including
agentscope.tracing._trace, so v2 can fail at import time or miss instrumentation coverage.Proposed Scope
agentscope >=1,<2in package metadata and test requirements.opentelemetry-util-genai/ExtendedTelemetryHandlerfor LLM, agent, tool, embedding, content, token, error, TTFT, metrics, and ReActStep behavior. Framework-local code should only adapt AgentScope v2 objects and lifecycle hooks.TracingMiddleware.Suggested v2 Contract Tests
agentscope.tracingTracingMiddlewarewithout duplicate LoongSuite spans