Skip to content

feat: enterprise otel exporter#33138

Merged
wylswz merged 23 commits intomainfrom
feat/otel-telemetry-ee
Mar 27, 2026
Merged

feat: enterprise otel exporter#33138
wylswz merged 23 commits intomainfrom
feat/otel-telemetry-ee

Conversation

@GareArc
Copy link
Copy Markdown
Contributor

@GareArc GareArc commented Mar 9, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

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 and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

Copilot AI review requested due to automatic review settings March 9, 2026 00:38
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. 💪 enhancement New feature or request labels Mar 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 00:39:32.825358295 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 00:39:24.981401625 +0000
@@ -92,8 +92,14 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Cannot find module `core.workflow.enums` [missing-import]
+   --> core/ops/ops_trace_manager.py:649:9
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -507,6 +513,8 @@
    --> dify_graph/nodes/variable_assigner/v2/node.py:224:24
 ERROR Pyrefly detected conflicting types while breaking a dependency cycle: `(t: SegmentType) -> Segment` is not assignable to `str`. Adding explicit type annotations might possibly help. [bad-assignment]
    --> dify_graph/variables/types.py:222:9
+ERROR Cannot find module `core.workflow.enums` [missing-import]
+ --> enterprise/telemetry/draft_trace.py:8:1
 ERROR Object of class `MissingRouter` has no attribute `include_router` [missing-attribute]
   --> extensions/ext_fastopenapi.py:39:5
 ERROR Argument `Literal['running'] | Any` is not assignable to parameter `value` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,20 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Could not import `CASE_ROUTING` from `core.telemetry.gateway` [missing-module-attribute]
+ --> tests/unit_tests/enterprise/telemetry/test_contracts.py:8:36
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Could not import `CASE_ROUTING` from `core.telemetry.gateway` [missing-module-attribute]
+  --> tests/unit_tests/enterprise/telemetry/test_gateway.py:10:5
+ERROR Could not import `CASE_TO_TRACE_TASK` from `core.telemetry.gateway` [missing-module-attribute]
+  --> tests/unit_tests/enterprise/telemetry/test_gateway.py:11:5
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances Dify's observability capabilities by integrating a dedicated OpenTelemetry framework for enterprise users. It provides a structured approach to collecting and exporting operational data, offering deep insights into application performance, resource consumption, and user interactions. The changes lay the groundwork for advanced monitoring and analytics, crucial for managing Dify in complex production environments, while maintaining a clear separation and optionality for community edition users.

Highlights

  • Enterprise OpenTelemetry (OTEL) Exporter: Introduced a new, comprehensive OpenTelemetry (OTEL) exporter specifically for Dify's enterprise edition, enabling detailed tracing, metrics, and structured logging for various application operations.
  • Telemetry Data Model & Configuration: Defined a robust telemetry data model including new trace entities (e.g., WorkflowNodeTraceInfo, PromptGenerationTraceInfo), operation types, and configuration options for OTLP endpoints, headers, API keys, and content inclusion via EnterpriseTelemetryConfig.
  • Enhanced Trace Correlation: Implemented deterministic trace and span ID generation, intelligent fallback for trace IDs, and explicit parent context linking to ensure accurate correlation across complex and nested workflows, as well as between different telemetry signals.
  • Granular Metrics & Logging: Added detailed counters for token usage (input, output, total), requests, and errors, along with histograms for operation durations. Structured logs now provide rich context for events, including content gating for sensitive data.
  • Modular Telemetry Gateway: Established a central telemetry gateway (core/telemetry/gateway.py) to route events based on their type and CE/EE eligibility, dispatching them to either the trace pipeline or a dedicated enterprise Celery queue for metric/log processing.
  • Improved Developer Experience: Updated api/README.md with more detailed manual setup instructions and marked the worker service as optional, streamlining the local development environment setup.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • api/README.md
    • Updated worker service description to be optional.
    • Added a new 'Manual commands' section with detailed setup and run steps for local development.
  • api/app_factory.py
    • Integrated ext_enterprise_telemetry into the Flask application initialization process.
  • api/configs/app_config.py
    • Imported EnterpriseTelemetryConfig.
    • Added EnterpriseTelemetryConfig to the main DifyConfig class.
  • api/configs/enterprise/init.py
    • Added EnterpriseTelemetryConfig class to define various OpenTelemetry configuration fields, such as endpoint, headers, protocol, API key, content inclusion, service name, and sampling rate.
  • api/core/app/apps/workflow/app_generator.py
    • Modified workflow generation to pass _parent_trace_context to the extras dictionary for improved trace correlation.
  • api/core/llm_generator/entities.py
    • Added an optional app_id field to RuleGeneratePayload and RuleStructuredOutputPayload for prompt generation tracing.
  • api/core/ops/entities/trace_entity.py
    • Updated type hints for inputs, outputs, and file_list to be more specific (e.g., list[Any], list[str]).
    • Introduced resolved_trace_id and resolved_parent_context properties to BaseTraceInfo for intelligent trace ID resolution and cross-workflow parent linking.
    • Added prompt_tokens, completion_tokens, and invoked_by fields to WorkflowTraceInfo.
    • Defined new trace information entities: PromptGenerationTraceInfo, WorkflowNodeTraceInfo, and DraftNodeExecutionTrace.
    • Added OperationType enum to categorize token metric labels.
    • Expanded TraceTaskName enum to include new trace types for draft node execution, prompt generation, and node execution.
  • api/core/ops/ops_trace_manager.py
    • Added helper functions _lookup_app_and_workspace_names, _lookup_credential_name, and _lookup_llm_credential_info for enriching telemetry data with application, workspace, and credential details.
    • Modified OpsTraceProviderConfigMap to correctly handle provider lookups.
    • Updated get_ops_trace_instance to filter out tenant-{uuid} formatted app IDs, which are not valid application IDs.
    • Introduced _get_user_id_from_metadata and _calculate_workflow_token_split methods to TraceTask for user identification and token usage breakdown.
    • Modified TraceTask.__init__ to pass user_id into kwargs if provided.
    • Updated TraceTask.preprocess to include new trace processing methods for prompt generation, node execution, and draft node execution.
    • Enhanced workflow_trace to capture prompt_tokens, completion_tokens, app_name, workspace_name, parent_trace_context, and invoked_by.
    • Improved message_trace to include tenant_id, app_id, user_id, app_name, workspace_name, node_execution_id, and refined end_time calculation.
    • Modified moderation_trace, suggested_question_trace, dataset_retrieval_trace, tool_trace, and generate_name_trace to incorporate node_execution_id into their metadata.
    • Added new trace methods: prompt_generation_trace, node_execution_trace, and draft_node_execution_trace for comprehensive event tracking.
    • Adjusted TraceQueueManager.add_trace_task to conditionally enqueue tasks based on whether enterprise telemetry is enabled or a trace instance is configured.
    • Refactored TraceQueueManager.send_to_celery to use a storage_id that can represent either an app_id or a tenant_id for file storage, and added robust error handling for file deletion.
  • api/core/telemetry/init.py
    • Added new file to serve as a facade for emitting telemetry events, translating TelemetryEvent objects into TelemetryCase and delegating to the telemetry gateway.
  • api/core/telemetry/events.py
    • Added new file defining TelemetryContext and TelemetryEvent data classes for standardized telemetry event structures.
  • api/core/telemetry/gateway.py
    • Added new file establishing a central routing layer for all telemetry events, mapping TelemetryCase to CaseRoute and dispatching events to either the trace pipeline or an enterprise-specific Celery queue. Includes logic for payload sizing and offloading to storage.
  • api/dify_graph/nodes/tool/tool_node.py
    • Added tool_name and credential_id to the tool_info dictionary for more detailed tool tracing.
  • api/enterprise/telemetry/DATA_DICTIONARY.md
    • Added new file providing a detailed data dictionary for all enterprise telemetry signals, including resource attributes, traces (spans), counters, histograms, and structured logs.
  • api/enterprise/telemetry/README.md
    • Added new file offering an overview of the Dify Enterprise OpenTelemetry exporter, its configuration, signal architecture, and correlation model.
  • api/enterprise/telemetry/contracts.py
    • Added new file defining core contracts for telemetry events, including TelemetryCase (enum of event types), SignalType (trace or metric_log), CaseRoute (routing configuration), and TelemetryEnvelope (event packaging).
  • api/enterprise/telemetry/draft_trace.py
    • Added new file with a helper function enqueue_draft_node_execution_trace to specifically handle and enqueue draft node execution traces.
  • api/enterprise/telemetry/enterprise_trace.py
    • Added new file containing the EnterpriseOtelTrace handler, responsible for processing various trace info types and emitting corresponding OTEL spans, metrics, and structured logs based on enterprise telemetry configurations.
  • api/enterprise/telemetry/entities/init.py
    • Added new file defining enums for EnterpriseTelemetrySpan, EnterpriseTelemetryEvent, EnterpriseTelemetryCounter, EnterpriseTelemetryHistogram, and the TokenMetricLabels model for consistent metric labeling.
  • api/enterprise/telemetry/event_handlers.py
    • Added new file containing Blinker signal handlers for application lifecycle events (created, updated, deleted) and feedback events, delegating their telemetry emission to the central gateway.
  • api/enterprise/telemetry/exporter.py
    • Added new file implementing the EnterpriseExporter class, which initializes and manages the OpenTelemetry exporter for enterprise telemetry, handling configuration parsing, sampling, and deterministic ID generation.
  • api/enterprise/telemetry/id_generator.py
    • Added new file providing a custom OTEL ID generator (CorrelationIdGenerator) for deterministic trace and span ID derivation based on correlation IDs.
  • api/enterprise/telemetry/metric_handler.py
    • Added new file defining EnterpriseMetricHandler, which processes enterprise metric/log telemetry events from the Celery queue, including deduplication and payload rehydration logic.
  • api/enterprise/telemetry/telemetry_log.py
    • Added new file with utility functions (emit_telemetry_log, emit_metric_only_event) for emitting structured JSON log lines for telemetry events, correlated with OTEL traces.
  • api/events/app_event.py
    • Added app_was_deleted and app_was_updated Blinker signals for tracking application lifecycle changes.
  • api/events/feedback_event.py
    • Added new file defining the feedback_was_created Blinker signal for tracking user feedback events.
  • api/extensions/ext_celery.py
    • Conditionally appended tasks.enterprise_telemetry_task to Celery imports if enterprise telemetry is enabled in the configuration.
  • api/extensions/ext_enterprise_telemetry.py
    • Added new file implementing a Flask extension for managing the lifecycle of enterprise telemetry, including exporter initialization, event handler registration, and graceful shutdown.
  • api/extensions/ext_otel.py
    • Modified OTLP exporter initialization to dynamically determine the insecure flag based on the endpoint scheme (http/https) and improved handling of API key authentication for both gRPC and HTTP protocols.
  • api/extensions/otel/parser/init.py
    • Exported the should_include_content function for external use.
  • api/extensions/otel/parser/base.py
    • Introduced should_include_content function to control whether sensitive content (inputs/outputs) is included in OpenTelemetry spans, respecting enterprise content gating settings.
    • Modified DefaultNodeOTelParser to use should_include_content before setting ChainAttributes.INPUT_VALUE and ChainAttributes.OUTPUT_VALUE.
  • api/extensions/otel/semconv/dify.py
    • Added new semantic convention attributes: INVOKED_BY, USAGE_INPUT_TOKENS, USAGE_OUTPUT_TOKENS, and USAGE_TOTAL_TOKENS for more detailed Dify-specific tracing.
  • api/tasks/enterprise_telemetry_task.py
    • Added new file defining a Celery task (process_enterprise_telemetry) responsible for processing enterprise metric/log telemetry envelopes by deserializing them and dispatching to the EnterpriseMetricHandler.
  • api/tests/unit_tests/core/ops/test_trace_queue_manager.py
    • Added new file containing unit tests for the TraceQueueManager's telemetry guard logic, verifying correct task enqueueing behavior based on telemetry enablement and trace instance configuration.
  • api/tests/unit_tests/core/telemetry/test_facade.py
    • Added new file with unit tests for the core.telemetry.emit() function, covering routing and enterprise-only filtering logic.
  • api/tests/unit_tests/core/telemetry/test_gateway_integration.py
    • Added new file containing unit tests for the telemetry gateway's integration, focusing on trace and metric routing, as well as CE eligibility.
  • api/tests/unit_tests/enterprise/telemetry/test_contracts.py
    • Added new file with unit tests for the telemetry gateway contracts, including TelemetryCase, CaseRoute, and TelemetryEnvelope models.
  • api/tests/unit_tests/enterprise/telemetry/test_event_handlers.py
    • Added new file containing unit tests for enterprise telemetry event handlers, verifying their interaction with the telemetry gateway for app and feedback events.
  • api/tests/unit_tests/enterprise/telemetry/test_exporter.py
    • Added new file with unit tests for the EnterpriseExporter, focusing on API key handling, header merging, and TLS configuration for OTLP exporters.
  • api/tests/unit_tests/enterprise/telemetry/test_gateway.py
    • Added new file containing unit tests for the telemetry gateway, covering routing table, trace/metric routing, and payload sizing/offloading.
  • api/tests/unit_tests/enterprise/telemetry/test_metric_handler.py
    • Added new file with unit tests for the EnterpriseMetricHandler, covering event dispatch, idempotency, payload rehydration, and specific event handling for app and feedback events.
  • api/tests/unit_tests/tasks/test_enterprise_telemetry_task.py
    • Added new file containing unit tests for the process_enterprise_telemetry Celery task, verifying its ability to process telemetry envelopes and handle various error scenarios.
Activity
  • The pull request description indicates that tests have been added for each introduced change.
  • The pull request description states that documentation has been updated accordingly.
  • The author has checked off all items in the checklist, including running lint and type-check commands.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 00:39:32.825358295 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 00:39:24.981401625 +0000
@@ -92,8 +92,14 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Cannot find module `core.workflow.enums` [missing-import]
+   --> core/ops/ops_trace_manager.py:649:9
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -507,6 +513,8 @@
    --> dify_graph/nodes/variable_assigner/v2/node.py:224:24
 ERROR Pyrefly detected conflicting types while breaking a dependency cycle: `(t: SegmentType) -> Segment` is not assignable to `str`. Adding explicit type annotations might possibly help. [bad-assignment]
    --> dify_graph/variables/types.py:222:9
+ERROR Cannot find module `core.workflow.enums` [missing-import]
+ --> enterprise/telemetry/draft_trace.py:8:1
 ERROR Object of class `MissingRouter` has no attribute `include_router` [missing-attribute]
   --> extensions/ext_fastopenapi.py:39:5
 ERROR Argument `Literal['running'] | Any` is not assignable to parameter `value` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,20 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Could not import `CASE_ROUTING` from `core.telemetry.gateway` [missing-module-attribute]
+ --> tests/unit_tests/enterprise/telemetry/test_contracts.py:8:36
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Could not import `CASE_ROUTING` from `core.telemetry.gateway` [missing-module-attribute]
+  --> tests/unit_tests/enterprise/telemetry/test_gateway.py:10:5
+ERROR Could not import `CASE_TO_TRACE_TASK` from `core.telemetry.gateway` [missing-module-attribute]
+  --> tests/unit_tests/enterprise/telemetry/test_gateway.py:11:5
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive enterprise-grade telemetry system using OpenTelemetry, which is a significant and well-structured addition. The new system supports detailed tracing, metrics, and logging, with features like content gating for privacy, robust error handling, and offloading large payloads. I've identified a logical issue in the LLM credential lookup and a minor improvement for exception logging. Overall, this is a high-quality contribution.

Comment thread api/core/ops/ops_trace_manager.py Outdated
Comment thread api/tasks/ops_trace_task.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an Enterprise Edition OpenTelemetry (OTLP) telemetry pipeline (exporter + routing + handlers) and wires it into the existing ops trace/task flow and app lifecycle events.

Changes:

  • Introduces a shared core.telemetry.gateway routing layer that dispatches trace cases to the ops trace queue and metric/log cases to a new enterprise_telemetry Celery task.
  • Implements enterprise telemetry exporter, trace/log emitters, and metric/log handlers (with payload offloading + rehydration).
  • Expands ops trace entities and manager logic to support additional trace types, cross-workflow parent context, and richer metadata.

Reviewed changes

Copilot reviewed 42 out of 44 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
api/tests/unit_tests/tasks/test_enterprise_telemetry_task.py Adds unit tests for the enterprise telemetry Celery task behavior.
api/tests/unit_tests/enterprise/telemetry/test_metric_handler.py Adds tests for metric/log handler routing, dedup, and rehydration behavior.
api/tests/unit_tests/enterprise/telemetry/test_gateway.py Adds tests for gateway routing (trace vs metric/log) and payload sizing/offload.
api/tests/unit_tests/enterprise/telemetry/test_exporter.py Adds tests for OTLP exporter config/header/TLS behavior.
api/tests/unit_tests/enterprise/telemetry/test_event_handlers.py Adds tests for blinker handlers emitting gateway events.
api/tests/unit_tests/enterprise/telemetry/test_contracts.py Adds tests for telemetry contracts and routing table completeness.
api/tests/unit_tests/enterprise/telemetry/init.py Test package marker for enterprise telemetry tests.
api/tests/unit_tests/core/telemetry/test_gateway_integration.py Adds integration-style tests for gateway exports and EE gating.
api/tests/unit_tests/core/telemetry/test_facade.py Adds tests for the core.telemetry.emit() facade and EE-only filtering.
api/tests/unit_tests/core/ops/test_trace_queue_manager.py Adds tests validating TraceQueueManager EE telemetry guard behavior.
api/tasks/ops_trace_task.py Hooks enterprise trace export into ops trace processing and hardens cleanup.
api/tasks/enterprise_telemetry_task.py New Celery task for processing enterprise metric/log envelopes.
api/extensions/otel/semconv/dify.py Adds additional semantic convention attributes for Dify spans.
api/extensions/otel/parser/base.py Adds EE content-gating helper and gates input/output span attributes.
api/extensions/otel/parser/init.py Re-exports should_include_content() from parser base.
api/extensions/ext_otel.py Adjusts OTLP gRPC exporter TLS autodetection and optional auth header injection.
api/extensions/ext_enterprise_telemetry.py New Flask extension to initialize enterprise exporter and register handlers.
api/extensions/ext_celery.py Conditionally imports the enterprise telemetry task into Celery.
api/events/feedback_event.py Introduces a blinker signal for feedback creation.
api/events/app_event.py Adds blinker signals for app deleted/updated.
api/enterprise/telemetry/telemetry_log.py Adds structured JSON telemetry log emitter + trace/span id helpers.
api/enterprise/telemetry/metric_handler.py Adds enterprise metric/log handler with dedup + rehydration + case routing.
api/enterprise/telemetry/id_generator.py Adds correlation-based deterministic OTEL trace/span ID generator.
api/enterprise/telemetry/exporter.py Adds dedicated enterprise OTLP exporter (trace + metrics) and factory.
api/enterprise/telemetry/event_handlers.py Adds blinker handlers that emit gateway telemetry events.
api/enterprise/telemetry/entities/init.py Defines enterprise telemetry enums and token metric label model.
api/enterprise/telemetry/enterprise_trace.py Implements enterprise trace processing (slim spans + rich logs + metrics).
api/enterprise/telemetry/draft_trace.py Adds helper to enqueue draft node execution traces via telemetry facade.
api/enterprise/telemetry/contracts.py Adds telemetry case enums, routing model, and envelope contract.
api/enterprise/telemetry/README.md Adds enterprise telemetry architecture and configuration docs.
api/enterprise/telemetry/DATA_DICTIONARY.md Adds a comprehensive data dictionary for emitted telemetry.
api/dify_graph/nodes/tool/tool_node.py Adds tool_name/credential_id into tool metadata for downstream telemetry.
api/core/telemetry/gateway.py New centralized telemetry routing (trace enqueue vs metric/log celery).
api/core/telemetry/events.py Adds telemetry event/context dataclasses.
api/core/telemetry/init.py Adds a facade to emit telemetry events keyed by TraceTaskName.
api/core/ops/ops_trace_manager.py Extends trace manager with EE telemetry gating, richer metadata, new trace types.
api/core/ops/entities/trace_entity.py Adds new trace info models, resolved IDs/parent context helpers, new task names.
api/core/llm_generator/entities.py Adds app_id to prompt generation payloads for tracing attribution.
api/core/app/apps/workflow/app_generator.py Plumbs _parent_trace_context into workflow generator extras.
api/configs/enterprise/init.py Adds enterprise telemetry configuration settings.
api/configs/app_config.py Wires enterprise telemetry config into DifyConfig.
api/app_factory.py Registers enterprise telemetry extension in app initialization.
api/README.md Updates developer run instructions and documents enterprise_telemetry queue usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/core/telemetry/gateway.py Outdated
Comment thread api/enterprise/telemetry/README.md
Comment thread api/enterprise/telemetry/metric_handler.py
Comment thread api/enterprise/telemetry/exporter.py Outdated
Comment thread api/extensions/ext_celery.py Outdated
@GareArc GareArc changed the title Feat: enterprise otel exporter feat: enterprise otel exporter Mar 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:15:14.902226815 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:15:06.760245330 +0000
@@ -92,8 +92,16 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `PROMPT_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:666:39
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `COMPLETION_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:670:43
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:15:14.902226815 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:15:06.760245330 +0000
@@ -92,8 +92,16 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `PROMPT_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:666:39
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `COMPLETION_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:670:43
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

Copilot AI review requested due to automatic review settings March 9, 2026 02:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:24:50.428671044 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:24:42.243637104 +0000
@@ -92,8 +92,16 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `PROMPT_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:666:39
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `COMPLETION_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:670:43
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:24:50.428671044 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:24:42.243637104 +0000
@@ -92,8 +92,16 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `PROMPT_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:666:39
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `COMPLETION_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:670:43
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:27:01.073829356 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:26:51.893779055 +0000
@@ -92,8 +92,16 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `PROMPT_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:666:39
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `COMPLETION_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:670:43
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:27:01.073829356 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:26:51.893779055 +0000
@@ -92,8 +92,16 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `PROMPT_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:666:39
+ERROR Class `WorkflowNodeExecutionMetadataKey` has no class attribute `COMPLETION_TOKENS` [missing-attribute]
+   --> core/ops/ops_trace_manager.py:670:43
+ERROR Returned type `WorkflowNodeTraceInfo | dict[Unknown, Unknown]` is not assignable to declared return type `DraftNodeExecutionTrace | dict[Unknown, Unknown]` [bad-return]
+    --> core/ops/ops_trace_manager.py:1388:20
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2032,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2610,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3103,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 44 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

api/core/ops/entities/trace_entity.py:25

  • isinstance() does not accept PEP604 unions (e.g. str | dict | list) as its second argument; this will raise TypeError at runtime. Replace with a tuple of types: isinstance(v, (str, dict, list)).
    def ensure_type(cls, v: str | dict[str, Any] | list[Any] | None) -> str | dict[str, Any] | list[Any] | None:
        if v is None:
            return None
        if isinstance(v, str | dict | list):
            return v

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/enterprise/telemetry/enterprise_trace.py
Comment thread api/enterprise/telemetry/enterprise_trace.py
Comment thread api/enterprise/telemetry/metric_handler.py
Comment thread api/core/ops/ops_trace_manager.py Outdated
Comment thread api/core/ops/ops_trace_manager.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:38:59.866824041 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:38:50.828981044 +0000
@@ -92,8 +92,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2026,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2604,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3097,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 02:38:59.866824041 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 02:38:50.828981044 +0000
@@ -92,8 +92,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2026,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2604,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3097,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

Copilot AI review requested due to automatic review settings March 9, 2026 03:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 03:20:33.109940276 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 03:20:24.387928604 +0000
@@ -92,8 +92,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2026,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2604,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3097,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 03:20:33.109940276 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 03:20:24.387928604 +0000
@@ -92,8 +92,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2026,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2604,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3097,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 43 out of 46 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/core/telemetry/gateway.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-09 03:36:09.532402683 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-09 03:36:01.514419553 +0000
@@ -92,8 +92,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:187:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1485:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Object of class `tuple` has no attribute `delta` [missing-attribute]
@@ -2024,6 +2026,14 @@
    --> 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 Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:59:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:60:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:61:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:62:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:44:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -2594,6 +2604,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -3079,6 +3097,14 @@
   --> tests/unit_tests/core/workflow/test_variable_pool.py:81:33
 ERROR Argument `TestWorkflowEntry.test_single_step_run_injects_code_limits.StubWorkflow` is not assignable to parameter `workflow` with type `Workflow` in function `core.workflow.workflow_entry.WorkflowEntry.single_step_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry.py:144:22
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
 ERROR Argument `dict[str, bytes | str]` is not assignable to parameter `headers` with type `Headers | Mapping[bytes, bytes] | Mapping[str, str] | Sequence[tuple[bytes, bytes]] | Sequence[tuple[str, str]] | None` in function `httpx._models.Response.__init__` [bad-argument-type]
   --> tests/unit_tests/factories/test_build_from_mapping.py:66:21
 ERROR Argument `datetime` is not assignable to parameter `created_at` with type `Decimal | bool | bytes | float | int | str | None` in function `fields.file_fields.FileWithSignedUrl.__init__` [bad-argument-type]

…ites

enqueue_draft_node_execution_trace was never called from production code.
Add the call after saving in workflow_service and rag_pipeline (both
single-step run paths).
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 04:05:06.577797488 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 04:04:55.381846370 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1452:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 04:05:06.577797488 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 04:04:55.381846370 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1452:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 04:19:57.015190305 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 04:19:46.073145845 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1452:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 04:19:57.015190305 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 04:19:46.073145845 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1452:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 05:30:07.197900785 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 05:29:55.758911337 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1452:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 05:30:07.197900785 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 05:29:55.758911337 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1452:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

- Fix workflow token count race: capture total_tokens in-memory at enqueue time
  to avoid stale DB read when the trace Celery task runs
- Add prompt/completion token split from node outputs["usage"] and wire into
  WorkflowTraceInfo and dify.tokens.input/output counters
- Fix workflow token split crash: PROMPT_TOKENS/COMPLETION_TOKENS enum members
  do not exist; rewrite to read from outputs["usage"] instead of execution_metadata
- Reduce DB query cost: project only outputs column, consolidate into existing session
- Fix moderation type: was hardcoded "unknown", now defaults to "input"
- Widen token type guard to (int, float) to prevent silent undercounting
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 06:39:35.408532480 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 06:39:24.938263602 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1508:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 06:39:35.408532480 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 06:39:24.938263602 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1508:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 06:41:43.197502575 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 06:41:32.880464784 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1512:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 06:41:43.197502575 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 06:41:32.880464784 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1512:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:312:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:386:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:466:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:470:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
-ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:478:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:486:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:495:12
 ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:505:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:506:12
 ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:516:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:517:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:581:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 07:37:57.805709084 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 07:37:46.195609883 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1512:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:315:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:389:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:473:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:481:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:482:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:489:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
-ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:508:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
-ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:519:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:520:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:584:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 07:38:04.721660613 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 07:37:53.249546856 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1512:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:315:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:389:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:473:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:481:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:482:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:489:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
-ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:508:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
-ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:519:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:520:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:584:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 07:37:57.805709084 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 07:37:46.195609883 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1512:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:315:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:389:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:473:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:481:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:482:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:489:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
-ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:508:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
-ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:519:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:520:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:584:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-27 07:38:04.721660613 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-27 07:37:53.249546856 +0000
@@ -60,8 +60,10 @@
    --> core/ops/mlflow_trace/mlflow_trace.py:395: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:414:24
+ERROR Class member `OpsTraceProviderConfigMap.__getitem__` overrides parent class `UserDict` in an inconsistent manner [bad-param-name-override]
+   --> core/ops/ops_trace_manager.py:189:9
 ERROR Object of class `dict` has no attribute `model_dump` [missing-attribute]
-   --> core/ops/ops_trace_manager.py:990:32
+    --> core/ops/ops_trace_manager.py:1512:32
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `BaseModel | Generator[BaseModel | Mapping[Unknown, Unknown] | str] | Mapping[Unknown, Unknown]` [unsafe-overlap]
   --> core/plugin/backwards_invocation/base.py:10:33
 ERROR Runtime checkable protocol `Generator` has an unsafe overlap with type `Generator[LLMResultChunkWithStructuredOutput] | LLMResultWithStructuredOutput` [unsafe-overlap]
@@ -4322,35 +4324,43 @@
 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:305:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:315:12
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:379:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:389:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:452:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:459:69
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:469:69
 ERROR Object of class `dict` has no attribute `workflow_run_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:462:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
 ERROR Object of class `dict` has no attribute `workflow_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:463:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:473:12
 ERROR Object of class `dict` has no attribute `flagged` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:471:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:481:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:472:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:482:12
 ERROR Object of class `dict` has no attribute `message_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:479:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:489:12
 ERROR Object of class `dict` has no attribute `documents` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:488:12
-ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:498:12
+ERROR Object of class `dict` has no attribute `tool_name` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:508:12
 ERROR Object of class `dict` has no attribute `time_cost` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:499:12
-ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
    --> tests/unit_tests/core/ops/test_ops_trace_manager.py:509:12
+ERROR Object of class `dict` has no attribute `outputs` [missing-attribute]
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:519:12
 ERROR Object of class `dict` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:510:12
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:520:12
 ERROR Argument `list[test_trace_queue_manager_send_to_celery.DummyTask]` is not assignable to parameter `tasks` with type `list[TraceTask]` in function `core.ops.ops_trace_manager.TraceQueueManager.send_to_celery` [bad-argument-type]
-   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:574:28
+   --> tests/unit_tests/core/ops/test_ops_trace_manager.py:584:28
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:53:9
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:54:9
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:55:9
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/ops/test_trace_queue_manager.py:56:9
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url` [bad-argument-type]
   --> tests/unit_tests/core/ops/test_utils.py:55:31
 ERROR Argument `None` is not assignable to parameter `url` with type `str` in function `core.ops.utils.validate_url_with_path` [bad-argument-type]
@@ -5663,6 +5673,14 @@
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
 ERROR Cannot index into `str` [bad-index]
    --> tests/unit_tests/core/schemas/test_resolver.py:687:23
+ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:44:5
+ERROR Object of class `ModuleType` has no attribute `TraceTask` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:45:5
+ERROR Object of class `ModuleType` has no attribute `OpsTraceManager` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:46:5
+ERROR Object of class `ModuleType` has no attribute `trace_manager_queue` [missing-attribute]
+  --> tests/unit_tests/core/telemetry/test_facade.py:47:5
 ERROR `dict[str, str]` is not assignable to TypedDict key `data` with type `BaseNodeData` [bad-typed-dict-key]
   --> tests/unit_tests/core/test_trigger_debug_event_selectors.py:56:46
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -6666,6 +6684,20 @@
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:840:73
 ERROR Argument `TestWorkflowEntryTracing.test_traced_node_run_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._traced_node_run` [bad-argument-type]
    --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:863:68
+ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:111:30
+ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:120:30
+ERROR Missing argument `event_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:129:30
+ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
+   --> tests/unit_tests/enterprise/telemetry/test_contracts.py:138:30
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.increment_counter` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:582:71
+ERROR Argument `dict[str, str]` is not assignable to parameter `labels` with type `dict[str, AttributeValue]` in function `enterprise.telemetry.exporter.EnterpriseExporter.record_histogram` [bad-argument-type]
+   --> tests/unit_tests/enterprise/telemetry/test_exporter.py:615:85
+ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[AttributeError]]) [no-matching-overload]
+  --> tests/unit_tests/enterprise/telemetry/test_id_generator.py:45:27
 ERROR Object of class `int` has no attribute `startswith` [missing-attribute]
   --> tests/unit_tests/extensions/otel/test_celery_sqlcommenter.py:25:16
 ERROR Cannot index into `object` [bad-index]

Copy link
Copy Markdown
Contributor

@wylswz wylswz left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 27, 2026
@wylswz wylswz added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 5a8a68c Mar 27, 2026
27 checks passed
@wylswz wylswz deleted the feat/otel-telemetry-ee branch March 27, 2026 08:09
wylswz added a commit that referenced this pull request Mar 27, 2026
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
Co-authored-by: Yunlu Wen <yunlu.wen@dify.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
QuantumGhost added a commit that referenced this pull request Mar 27, 2026
Merge feat: enterprise otel exporter (#33138) into lts/1.13

Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com>
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request lgtm This PR has been approved by a maintainer needs revision for anti-slop needs-revision size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants