Skip to content

refactor(api): move trace providers#35144

Merged
wylswz merged 8 commits intolanggenius:mainfrom
wylswz:chore/trace-provider
Apr 17, 2026
Merged

refactor(api): move trace providers#35144
wylswz merged 8 commits intolanggenius:mainfrom
wylswz:chore/trace-provider

Conversation

@wylswz
Copy link
Copy Markdown
Contributor

@wylswz wylswz commented Apr 14, 2026

Summary

Fixes #35050 . Moved tracers along with their dependencies to provider workspaces.

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 14, 2026
@wylswz wylswz marked this pull request as draft April 14, 2026 07:12
@wylswz wylswz self-assigned this Apr 14, 2026
@dosubot dosubot bot added the refactor label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 07:14:02.471544997 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 07:13:50.773345151 +0000
@@ -58,16 +58,6 @@
    --> core/model_manager.py:344:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:361:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -132,6 +122,208 @@
   --> extensions/storage/huawei_obs_storage.py:31:20
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:231:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:29:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:29:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:32:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:35:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:32:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:32:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:35:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:38:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:25:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:25:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:28:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:31:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:157:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:164:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:171:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:179:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:186:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:193:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:216:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:242:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:285:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:294:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:328:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:89:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:94:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:98:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:102:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:106:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:110:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:212:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:259:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:265:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:283:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:289:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:291:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:307:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:313:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:329:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:397:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:409:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:413:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:417:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:455:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:461:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:477:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:489:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:500:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:525:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:536:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:547:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:558:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:35:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:35:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:38:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:41:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4089,210 +4281,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:137:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 07:16:21.447197630 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 07:16:11.571207144 +0000
@@ -58,16 +58,6 @@
    --> core/model_manager.py:344:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:361:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -132,6 +122,208 @@
   --> extensions/storage/huawei_obs_storage.py:31:20
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4089,210 +4281,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:137:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@wylswz wylswz changed the title chore: move trace providers refactor(api): move trace providers Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 08:05:39.947964607 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 08:05:27.674723993 +0000
@@ -58,16 +58,6 @@
    --> core/model_manager.py:344:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:361:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -132,6 +122,208 @@
   --> extensions/storage/huawei_obs_storage.py:31:20
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4089,210 +4281,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:137:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@wylswz wylswz marked this pull request as ready for review April 14, 2026 08:11
@wylswz
Copy link
Copy Markdown
Contributor Author

wylswz commented Apr 14, 2026

@dosubot review this pr plz

@dosubot
Copy link
Copy Markdown

dosubot bot commented Apr 14, 2026

Here's my review of this PR:

Summary

This PR moves all 10 ops trace providers out of api/core/ops/ into separate uv workspace packages under api/providers/trace/trace-*/, following the same pattern established for VDB providers in #34899 [1]. The goal is to make trace provider dependencies optional and individually selectable, reducing the default dependency footprint.

What Changed

Providers moved (each into api/providers/trace/trace-<name>/): Aliyun, Arize/Phoenix, Langfuse, LangSmith, MLflow/Databricks, Opik, Tencent, Weave [2].

Key structural changes:

  • Each provider is now a standalone uv workspace package with its own pyproject.toml, src/dify_trace_<name>/ layout, PEP 561 py.typed marker, and co-located tests
  • Provider-specific config classes (e.g. LangfuseConfig, ArizeConfig) moved from the monolithic config_entity.py into each provider's config.py
  • config_entity.py slimmed from ~272 lines to ~57 lines — only TracingProviderEnum, BaseTracingConfig, and shared constants remain [3]
  • OpsTraceProviderConfigMap.__getitem__ now imports from provider packages (e.g. from dify_trace_langfuse.config import LangfuseConfig) instead of core.ops.entities.config_entity, wrapped in a try/except ImportError for graceful degradation [2]
  • Vendor SDK dependencies (langfuse, langsmith, opik, weave, mlflow-skinny, arize-phoenix-otel) removed from the root api/pyproject.toml and placed in individual provider pyproject.toml files
  • New dependency groups (trace-all, trace-langfuse, trace-aliyun, etc.) added so users can opt in/out via --group/--no-group flags
  • Tests relocated to sit alongside each provider package, and the pytest runner script updated to discover them

Looks Good ✅

  1. Clean separation of concerns — each provider is self-contained with config, trace implementation, entities, and tests
  2. Backward-compatible registry — the match/case dispatch in OpsTraceProviderConfigMap is preserved; only import paths change
  3. Graceful failureexcept ImportError gives a clear error message when a provider isn't installed
  4. Excellent documentation — the new providers/trace/README.md is thorough, covering architecture, implementation steps, registration, and package layout
  5. Tests co-located — provider tests move with the code, and new config-specific test files are added per provider
  6. Consistent with VDB pattern — mirrors the providers/vdb/ workspace layout already in place

Suggestions / Questions 🔍

  1. validate_url and validate_url_with_path still imported in config_entity.py — after removing all concrete config classes, the remaining BaseTracingConfig only uses validate_url (via validate_endpoint_url) and validate_project_name. The unused validate_url_with_path import could be removed as well, though it's possible subclass consumers rely on it being re-exported. Worth a quick check.

  2. Missing conftest.py / __init__.py in some test directories — the new test paths like providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/ don't appear to have __init__.py or conftest.py files. If pytest discovery relies on these (especially for fixtures), they might be needed. Double-check that pytest --collect-only discovers all tests correctly.

  3. dify-trace-aliyun has no external dependencies — its pyproject.toml has an empty dependencies = [] list, but the implementation imports opentelemetry packages. These are satisfied by the root api/pyproject.toml dependencies, but if someone installs the package standalone, it would fail. Consider whether OTel deps should be declared in the aliyun provider's own pyproject.toml (similar to how dify-trace-tencent explicitly lists them).

  4. dify-trace-tencent pins exact OTel versions (==1.41.0, ==0.62b0) — these match the root project but create a fragile coupling. If the root upgrades OTel, these will conflict. Consider using compatible-release specifiers (~=1.41.0) or inheriting from the root.

  5. Import ordering in tests — several test files now import from dify_trace_* before core.ops.* or third-party libs, which is fine functionally but inconsistent with the project's isort configuration. If CI enforces import sorting, these may need adjustment.

  6. No __init__.py files in some tests/ directories — e.g., providers/trace/trace-aliyun/tests/ and providers/trace/trace-aliyun/tests/unit_tests/. Depending on your test configuration this may or may not matter.

Overall this is a well-structured refactor that achieves its goal cleanly. Nice work! 👍

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Chat with Dosu Open in Cursor  Share on X

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 08:49:57.858901631 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 08:49:46.766913227 +0000
@@ -58,16 +58,6 @@
    --> core/model_manager.py:344:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:361:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -132,6 +122,208 @@
   --> extensions/storage/huawei_obs_storage.py:31:20
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4089,210 +4281,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:137:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 08:50:29.065077692 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 08:50:19.301108808 +0000
@@ -58,16 +58,6 @@
    --> core/model_manager.py:344:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:361:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -132,6 +122,208 @@
   --> extensions/storage/huawei_obs_storage.py:31:20
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4089,210 +4281,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:137:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-15 07:18:25.668675049 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-15 07:18:16.834521734 +0000
@@ -62,16 +62,6 @@
    --> core/model_manager.py:344:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:361:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -124,6 +114,208 @@
   --> extensions/storage/huawei_obs_storage.py:31:20
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4095,210 +4287,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:137:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@wylswz wylswz force-pushed the chore/trace-provider branch from f3c342e to 6f4dca1 Compare April 17, 2026 07:32
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-17 07:34:32.571670447 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-17 07:34:21.507709515 +0000
@@ -66,16 +66,6 @@
    --> core/model_manager.py:343:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:360:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -130,6 +120,228 @@
   --> fields/conversation_variable_fields.py:60:24
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:68:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:275:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:281:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:307:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:308:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:329:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:343:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:344:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:353:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:376:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:377:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:486:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:509:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:518:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:541:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:548:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:575:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:587:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:608:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:609:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:619:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:624:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:625:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:646:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:647:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:175:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:216:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:249:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Cannot find module `core.ops.arize_phoenix_trace.arize_phoenix_trace` [missing-import]
+ --> providers/trace/trace-arize-phoenix/tests/unit_tests/test_arize_phoenix_trace.py:5:1
+ERROR Cannot find module `core.ops.langfuse_trace.entities.langfuse_trace_entity` [missing-import]
+  --> providers/trace/trace-langfuse/tests/unit_tests/langfuse_trace/test_langfuse_trace.py:29:1
+ERROR Cannot find module `core.ops.langfuse_trace.langfuse_trace` [missing-import]
+  --> providers/trace/trace-langfuse/tests/unit_tests/langfuse_trace/test_langfuse_trace.py:36:1
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Cannot find module `core.ops.langfuse_trace.langfuse_trace` [missing-import]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:12:1
+ERROR Cannot find module `core.ops.langsmith_trace.entities.langsmith_trace_entity` [missing-import]
+  --> providers/trace/trace-langsmith/tests/unit_tests/langsmith_trace/test_langsmith_trace.py:25:1
+ERROR Cannot find module `core.ops.langsmith_trace.langsmith_trace` [missing-import]
+  --> providers/trace/trace-langsmith/tests/unit_tests/langsmith_trace/test_langsmith_trace.py:30:1
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Cannot find module `core.ops.mlflow_trace.mlflow_trace` [missing-import]
+  --> providers/trace/trace-mlflow/tests/unit_tests/mlflow_trace/test_mlflow_trace.py:25:1
+ERROR Cannot find module `core.ops.opik_trace.opik_trace` [missing-import]
+  --> providers/trace/trace-opik/tests/unit_tests/opik_trace/test_opik_trace.py:22:1
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Cannot find module `core.ops.tencent_trace.tencent_trace` [missing-import]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_tencent_trace.py:19:1
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
+ERROR Cannot find module `core.ops.weave_trace.entities.weave_trace_entity` [missing-import]
+  --> providers/trace/trace-weave/tests/unit_tests/weave_trace/test_weave_trace.py:26:1
+ERROR Cannot find module `core.ops.weave_trace.weave_trace` [missing-import]
+  --> providers/trace/trace-weave/tests/unit_tests/weave_trace/test_weave_trace.py:27:1
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4073,210 +4285,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:136:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-17 07:43:30.622301523 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-17 07:43:19.266305284 +0000
@@ -66,16 +66,6 @@
    --> core/model_manager.py:343:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:360:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -130,6 +120,208 @@
   --> fields/conversation_variable_fields.py:60:24
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4073,210 +4265,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:136:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-17 07:43:54.427518786 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-17 07:43:43.365611069 +0000
@@ -66,16 +66,6 @@
    --> core/model_manager.py:343:13
 ERROR Missing positional argument `function` in function `ModelInstance._round_robin_invoke` [bad-argument-count]
    --> core/model_manager.py:360:13
-ERROR Argument `dict[str, list[str] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:271:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:335:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:372:24
-ERROR Argument `dict[str, dict[str, Any] | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:396:24
-ERROR Argument `dict[str, int | str | None]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `mlflow.tracing.fluent.start_span_no_context` [bad-argument-type]
-   --> core/ops/mlflow_trace/mlflow_trace.py:415:24
 ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
    --> core/ops/ops_trace_manager.py:206:9
 ERROR Object of class `NoneType` has no attribute `data_source_type` [missing-attribute]
@@ -130,6 +120,208 @@
   --> fields/conversation_variable_fields.py:60:24
 ERROR Argument `Module[Crypto.Hash.SHA1] | Unknown` is not assignable to parameter with type `Hash | HashModule` [bad-argument-type]
   --> libs/gmpy2_pkcs10aep_cipher.py:73:49
+ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:228:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:229:16
+ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/data_exporter/test_traceclient.py:230:16
+ERROR Missing argument `span_id` in function `dify_trace_aliyun.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/entities/test_aliyun_trace_entity.py:67:21
+ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
+  --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:66:21
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:273:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:279:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:305:16
+ERROR Type `object` is not iterable [not-iterable]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:306:5
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:327:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:341:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:342:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:351:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:374:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:375:12
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:484:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:507:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:516:98
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:539:102
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:546:103
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:573:96
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:585:97
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:603:50
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:605:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:606:20
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:607:21
+ERROR Object of class `object` has no attribute `clear` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:617:5
+ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `dify_trace_aliyun.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:621:57
+ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:622:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:623:12
+ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:644:16
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace.py:645:12
+ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `dify_trace_aliyun.utils.format_retrieval_documents` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:173:39
+ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_input_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:214:34
+ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `dify_trace_aliyun.utils.format_output_messages` [bad-argument-type]
+   --> providers/trace/trace-aliyun/tests/unit_tests/aliyun_trace/test_aliyun_trace_utils.py:247:35
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:28:25
+ERROR Missing argument `endpoint` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:31:25
+ERROR Missing argument `license_key` in function `dify_trace_aliyun.config.AliyunConfig.__init__` [missing-argument]
+  --> providers/trace/trace-aliyun/tests/unit_tests/test_config_entity.py:34:25
+ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `dify_trace_arize_phoenix.arize_phoenix_trace.set_span_status` [bad-argument-type]
+   --> providers/trace/trace-arize-phoenix/tests/unit_tests/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:31:27
+ERROR Missing argument `secret_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:34:27
+ERROR Missing argument `public_key` in function `dify_trace_langfuse.config.LangfuseConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langfuse/tests/unit_tests/test_config_entity.py:37:27
+ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `dify_trace_langfuse.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
+   --> providers/trace/trace-langfuse/tests/unit_tests/test_langfuse_trace.py:137:61
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:24:28
+ERROR Missing argument `project` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:27:28
+ERROR Missing argument `api_key` in function `dify_trace_langsmith.config.LangSmithConfig.__init__` [missing-argument]
+  --> providers/trace/trace-langsmith/tests/unit_tests/test_config_entity.py:30:28
+ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:158:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:165:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:172:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:180:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:187:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:194:28
+ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:217:16
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:218:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:243:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:286:24
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:295:28
+ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
+   --> providers/trace/trace-opik/tests/unit_tests/test_opik_trace.py:329:28
+ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:87:5
+ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:88:5
+ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:92:5
+ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:93:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+  --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:97:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:101:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:105:5
+ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:109:5
+ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `dify_trace_tencent.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:211:52
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:258:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:264:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:279:5
+ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:280:5
+ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:281:5
+ERROR Object of class `object` has no attribute `end` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:282:5
+ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:288:32
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:290:5
+ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:305:5
+ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:306:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:312:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:328:5
+ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:394:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:395:5
+ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:396:5
+ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:408:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:412:5
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:416:5
+ERROR Object of class `object` has no attribute `exception` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:454:5
+ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:460:5
+ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:476:16
+ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:488:37
+ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `dify_trace_tencent.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:499:39
+ERROR Object of class `object` has no attribute `debug` [missing-attribute]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:524:5
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:535:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:546:12
+ERROR Cannot index into `object` [bad-index]
+   --> providers/trace/trace-tencent/tests/unit_tests/tencent_trace/test_client.py:557:12
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:34:24
+ERROR Missing argument `project` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:37:24
+ERROR Missing argument `api_key` in function `dify_trace_weave.config.WeaveConfig.__init__` [missing-argument]
+  --> providers/trace/trace-weave/tests/unit_tests/test_config_entity.py:40:24
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
@@ -4073,210 +4265,8 @@
   --> tests/unit_tests/core/moderation/api/test_api.py:47:35
 ERROR Argument `Literal['invalid']` is not assignable to parameter `config` with type `dict[str, Any] | None` in function `core.moderation.base.Moderation.__init__` [bad-argument-type]
     --> tests/unit_tests/core/moderation/test_sensitive_word_filter.py:1282:92
-ERROR Object of class `NoneType` has no attribute `trace_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:229:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:230:16
-ERROR Object of class `NoneType` has no attribute `span_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/data_exporter/test_traceclient.py:231:16
-ERROR Missing argument `span_id` in function `core.ops.aliyun_trace.entities.aliyun_trace_entity.SpanData.__init__` [missing-argument]
-  --> tests/unit_tests/core/ops/aliyun_trace/entities/test_aliyun_trace_entity.py:68:21
-ERROR Argument `int` is not assignable to parameter `trace_flags` with type `TraceFlags | None` in function `opentelemetry.trace.span.SpanContext.__new__` [bad-argument-type]
-  --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:66:21
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:273:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:279:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:305:16
-ERROR Type `object` is not iterable [not-iterable]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:306:5
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:327:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:341:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:342:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:351:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:374:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:375:12
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_task_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:484:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:507:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_tool_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:516:98
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:539:102
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_retrieval_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:546:103
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:573:96
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.build_workflow_llm_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:585:97
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:603:50
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:605:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:606:20
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:607:21
-ERROR Object of class `object` has no attribute `clear` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:617:5
-ERROR Argument `SimpleNamespace` is not assignable to parameter `trace_metadata` with type `TraceMetadata` in function `core.ops.aliyun_trace.aliyun_trace.AliyunDataTrace.add_workflow_span` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:621:57
-ERROR Argument `object` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:622:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:623:12
-ERROR Object of class `TraceClient` has no attribute `added_spans` [missing-attribute]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:644:16
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace.py:645:12
-ERROR Argument `Literal['not a list']` is not assignable to parameter `retrieval_documents` with type `list[Unknown]` in function `core.ops.aliyun_trace.utils.format_retrieval_documents` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:173:39
-ERROR Argument `None` is not assignable to parameter `process_data` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_input_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:214:34
-ERROR Argument `None` is not assignable to parameter `outputs` with type `Mapping[str, Any]` in function `core.ops.aliyun_trace.utils.format_output_messages` [bad-argument-type]
-   --> tests/unit_tests/core/ops/aliyun_trace/test_aliyun_trace_utils.py:247:35
-ERROR Argument `test_set_span_status.SilentError` is not assignable to parameter `error` with type `Exception | str | None` in function `core.ops.arize_phoenix_trace.arize_phoenix_trace.set_span_status` [bad-argument-type]
-   --> tests/unit_tests/core/ops/arize_phoenix_trace/test_arize_phoenix_trace.py:132:27
-ERROR Object of class `ModuleType` has no attribute `Histogram` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:88:5
-ERROR Object of class `ModuleType` has no attribute `MeterProvider` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:89:5
-ERROR Object of class `ModuleType` has no attribute `AggregationTemporality` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:93:5
-ERROR Object of class `ModuleType` has no attribute `PeriodicExportingMetricReader` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:94:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-  --> tests/unit_tests/core/ops/tencent_trace/test_client.py:98:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:102:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:106:5
-ERROR Object of class `ModuleType` has no attribute `OTLPMetricExporter` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:110:5
-ERROR Argument `Literal[123]` is not assignable to parameter `endpoint` with type `str` in function `core.ops.tencent_trace.client.TencentTraceClient._resolve_grpc_target` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:212:52
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:259:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:265:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:280:5
-ERROR Object of class `object` has no attribute `add_event` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:281:5
-ERROR Object of class `object` has no attribute `set_status` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:282:5
-ERROR Object of class `object` has no attribute `end` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:283:5
-ERROR Cannot set item in `dict[int, SpanContext]` [unsupported-operation]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:289:32
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:291:5
-ERROR Object of class `object` has no attribute `NonRecordingSpan` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:306:5
-ERROR Object of class `object` has no attribute `set_span_in_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:307:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:313:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:329:5
-ERROR Object of class `object` has no attribute `force_flush` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:395:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:396:5
-ERROR Object of class `object` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:397:5
-ERROR Object of class `NoneType` has no attribute `shutdown` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:409:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:413:5
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:417:5
-ERROR Object of class `object` has no attribute `exception` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:455:5
-ERROR Object of class `object` has no attribute `get_span_context` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:461:5
-ERROR Object of class `object` has no attribute `set_attributes` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:477:16
-ERROR Argument `dict[str, int | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_llm_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:489:37
-ERROR Argument `dict[str, bool | object]` is not assignable to parameter `attributes` with type `dict[str, str] | None` in function `core.ops.tencent_trace.client.TencentTraceClient.record_trace_duration` [bad-argument-type]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:500:39
-ERROR Object of class `object` has no attribute `debug` [missing-attribute]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:525:5
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:536:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:547:12
-ERROR Cannot index into `object` [bad-index]
-   --> tests/unit_tests/core/ops/tencent_trace/test_client.py:558:12
 ERROR Method `trace` inherited from class `BaseTraceInstance` has no implementation and cannot be accessed via `super()` [missing-attribute]
   --> tests/unit_tests/core/ops/test_base_trace_instance.py:17:9
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:140:27
-ERROR Missing argument `secret_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:143:27
-ERROR Missing argument `public_key` in function `core.ops.entities.config_entity.LangfuseConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:146:27
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:172:28
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:175:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.LangSmithConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:178:28
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:259:24
-ERROR Missing argument `project` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:262:24
-ERROR Missing argument `api_key` in function `core.ops.entities.config_entity.WeaveConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:265:24
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:311:25
-ERROR Missing argument `endpoint` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:314:25
-ERROR Missing argument `license_key` in function `core.ops.entities.config_entity.AliyunConfig.__init__` [missing-argument]
-   --> tests/unit_tests/core/ops/test_config_entity.py:317:25
-ERROR Argument `Literal['invalid']` is not assignable to parameter `time_to_first_token` with type `float | int | None` in function `core.ops.langfuse_trace.langfuse_trace.LangFuseDataTrace._get_completion_start_time` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_langfuse_trace.py:136:61
-ERROR Object of class `FunctionType` has no attribute `called` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:157:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:164:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:171:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:179:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:186:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:193:28
-ERROR Object of class `FunctionType` has no attribute `call_count` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:216:16
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:217:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:242:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:285:24
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:294:28
-ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_opik_trace.py:328:28
 ERROR `None` is not subscriptable [unsupported-operation]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:316:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

@wylswz wylswz enabled auto-merge April 17, 2026 07:46
@wylswz wylswz added this pull request to the merge queue Apr 17, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 17, 2026
Merged via the queue into langgenius:main with commit 881a9a1 Apr 17, 2026
28 checks passed
@wylswz wylswz deleted the chore/trace-provider branch April 17, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Move ops tracer providers into api/providers

2 participants