fix(nodes): preserve dot in event type filter prefix matching#516
fix(nodes): preserve dot in event type filter prefix matching#516staging-devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Strip only the trailing '*' from glob patterns like 'vad.*' so the
prefix retains the dot ('vad.') and no longer matches underscore-
separated names like 'vad_something'.
The separate '.*' branch is removed since the generic '*' branch
now handles both cases correctly.
Closes #510
Signed-off-by: streamkit-devin <devin@streamkit.dev>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| let prefix = &pattern[..pattern.len() - 2]; | ||
| event_type.starts_with(prefix) | ||
| } else if pattern.ends_with('*') { | ||
| if pattern.ends_with('*') { |
There was a problem hiding this comment.
🟡 Parallel telemetry tap filter still strips the dot from .* patterns
This change fixes TelemetryOutNode so event_type_filter: ["vad.*"] requires the literal vad. prefix, but the same public filter on core::telemetry_tap still has the old special case that strips .* to vad before calling starts_with (crates/nodes/src/core/telemetry_tap.rs:120-126, registered as core::telemetry_tap at crates/nodes/src/core/mod.rs:137-148). Pipelines using the tap node with the documented vad.* pattern will still emit unrelated event types such as vad_something, leaving the prefix-matching fix inconsistent across the telemetry nodes.
Prompt for agents
Apply the same dot-preserving event_type_filter semantics to core::telemetry_tap. Its TelemetryTapNode::matches_event_type_filter in crates/nodes/src/core/telemetry_tap.rs still treats patterns ending in `.*` specially by removing both the star and the dot, so `vad.*` matches `vad_something`. Update that matcher (or share the implementation with TelemetryOutNode) so trailing `*` removes only the star, and add a regression assertion comparable to TelemetryOutNode's `vad_something` case.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Good catch — applied the same fix to TelemetryTapNode::matches_event_type_filter and added a vad_something regression assertion. See 95f69b9.
The telemetry_tap node had the same bug as telemetry_out — stripping both '.' and '*' from '.*' patterns. Apply the identical fix and add a regression assertion. Signed-off-by: streamkit-devin <devin@streamkit.dev>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #516 +/- ##
==========================================
- Coverage 79.39% 79.38% -0.01%
==========================================
Files 232 232
Lines 66904 66900 -4
Branches 1909 1909
==========================================
- Hits 53117 53111 -6
- Misses 13781 13783 +2
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
matches_event_type_filterin bothTelemetryOutNodeandTelemetryTapNodestripped both.*from glob patterns likevad.*, producing prefixvadwhich incorrectly matched underscore-separated names likevad_something.*is stripped, sovad.*produces prefixvad.and matchesvad.speech_startbut notvad_something. A barevad*still matches both..*branch is removed since the generic*branch handles both cases correctly after this change.vad.*rejectsvad_something.Closes #510
Review & Validation
vad.*matchesvad.speech_start/vad.speech_endbut notvad_somethingvad*still matches bothvad.speech_startandvad_somethingstt.result) still works and rejectsstt.result.extratelemetry_outandtelemetry_tapnodes have consistent behaviorLink to Devin session: https://staging.itsdev.in/sessions/8e91aee7c1794fc3ac29ded15fcc0230
Requested by: @streamer45
Devin Review
61af307(HEAD is95f69b9)