Skip to content

Conversation

@skull8888888
Copy link
Member

@skull8888888 skull8888888 commented Dec 9, 2025

Note

Introduce semantic events pipeline with clustering and source-aware events, unify workers, and add frontend for managing code/semantic events and clusters.

  • Backend:
    • Semantic Events: Add SemanticEventHandler, queues (semantic_event_*), trigger spans cache (semantic_event_trigger_spans), and DB modules for semantic event definitions/triggers; write events to ClickHouse with source.
    • Clustering: Add event clustering flow (event_cluster_configs, event_clustering_*), mustache templating, locking, and service call; new CH view events_v0 with clusters.
    • Workers: Introduce generic worker framework and migrate spans, browser events, evaluators, payloads, notifications, Quickwit indexer, semantic events, and clustering to it.
    • Events: Record span events via record_span_events; add EventSource and propagate to CH/queries; remove old trace summary flow.
    • Health/Features: Simplify probes; add SemanticEvents and update Clustering flags.
  • Frontend:
    • Events UI: Split into Semantic and Code tabs/pages; new CRUD/API for semantic event definitions; manage trigger spans and prompts; display events with source filter and attributes first.
    • Clustering UI: Add clusters table per event, APIs to get/manage cluster config; start/disable clustering dialogs with mustache editor.
    • Table Infra: Infinite table supports optional "Load More" button; header breadcrumbs support links.
  • DB/SQL:
    • Add tables: event_cluster_configs, event_clusters, semantic_event_definitions, semantic_event_trigger_spans; enable vector extension.
    • ClickHouse: add events.source and events_v0 view; update queries to filter by source.

Written by Cursor Bugbot for commit 712f06e. This will update automatically on new commits. Configure here.

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Dec 9, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

const GetLastEventSchema = z.object({
projectId: z.string(),
name: z.string(),
eventSource: z.enum(["CODE", "SEMANTIC"]),
Copy link

Choose a reason for hiding this comment

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

Bug: Case mismatch in eventSource query parameter

The GetLastEventSchema defines eventSource as z.enum(["CODE", "SEMANTIC"]) (uppercase), but the backend Rust code stores the source field as lowercase "code" or "semantic" in ClickHouse (via EventSource::to_string()). The frontend pages pass 'CODE' and 'SEMANTIC' to getLastEvent, which queries ClickHouse with these uppercase values. Since ClickHouse string comparisons are case-sensitive, the query source = {source: String} will never match any records, causing getLastEvent to always return no results.

Additional Locations (2)

Fix in Cursor Fix in Web

* feat: add template prefill

* feat: update type, always pass prompt, structured output
.map_err(|e| {
log::warn!("Failed to call service ({}): {:?}", service_url, e);
backoff::Error::transient(anyhow::Error::from(e))
})?;
Copy link

Choose a reason for hiding this comment

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

Bug: Missing HTTP request timeout in service utility function

The new call_service_with_retry function does not set a timeout on individual HTTP requests. The old clustering code explicitly included .timeout(Duration::from_secs(60)) to prevent requests from hanging indefinitely. The backoff's max_elapsed_time only controls retry timing, not individual request duration. If an external service becomes unresponsive, worker threads calling this function (clustering and semantic events handlers) will block forever, causing the worker pool to gradually degrade.

Additional Locations (1)

Fix in Cursor Fix in Web

// 8 bytes for timestamp,
return 16 + 16 + 16 + 8 + 8 + self.name.len() + estimate_json_size(&self.attributes);
return 16 + 16 + 16 + 8 + self.name.len() + estimate_json_size(&self.attributes);
}
Copy link

Choose a reason for hiding this comment

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

Bug: Event size estimate missing new source field

The estimate_size_bytes function calculates event size for usage tracking but doesn't include the newly added source field. The old created_at field (8 bytes) was removed from the calculation, but the new source field (which stores "CODE" or "SEMANTIC") wasn't added. This causes size estimates to be slightly smaller than actual, affecting workspace usage limit calculations.

Fix in Cursor Fix in Web

"project_id": message.project_id.to_string(),
"trace_id": message.trace_id.to_string(),
"event_definition": serde_json::to_value(event_definition).unwrap(),
});
Copy link

Choose a reason for hiding this comment

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

Bug: Missing trigger_span_id in semantic event service request

The request body sent to the semantic event service is missing trigger_span_id. The SemanticEventMessage struct contains this field and it's passed through the queue correctly, but when constructing the HTTP request body, only project_id, trace_id, and event_definition are included. The old code in summary.rs included "trigger_span_id": message.trigger_span_id.to_string() in the request. The external service likely needs this field to identify which span triggered the semantic event analysis.

Fix in Cursor Fix in Web

@skull8888888 skull8888888 merged commit 24766df into dev Dec 11, 2025
5 checks passed
@skull8888888 skull8888888 deleted the patterns branch December 11, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants