Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

fix(beaconjson): accept future Claude event names

shukieshahe1f45f5da004
diff --git a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
index bdbbd342..9e92d461 100644
--- a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
+++ b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
@@ -473,10 +473,7 @@ func ClaudeLogEventName(attrs map[string]interface{}, body string) string {
}
normalized := strings.ToLower(strings.TrimSpace(FirstString(attrs, "event.name")))
if strings.HasPrefix(normalized, "claude_code.") {
- if _, ok := claudeLogEventClassifications[normalized]; ok {
- return normalized
- }
- return ""
+ return normalized
}
if normalized != "" {
candidate := "claude_code." + normalized
diff --git a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go
index 5fb36f38..f0ac84c7 100644
--- a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go
+++ b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go
@@ -877,6 +877,18 @@ func TestClaudeUnknownFullBodyDefaultsToSessionActivity(t *testing.T) {
if got := ClaudeLogEventName(map[string]interface{}{"event.name": "future_lifecycle_event"}, "unstructured body"); got != "" {
t.Fatalf("unknown short event normalized to %q, want no match", got)
}
+ if got := ClaudeLogEventName(map[string]interface{}{"event.name": "claude_code.future_lifecycle_event"}, "unstructured body"); got != "claude_code.future_lifecycle_event" {
+ t.Fatalf("unknown namespaced event normalized to %q, want safe full-name match", got)
+ }
+
+ namespaced := plog.NewLogRecord()
+ namespaced.Body().SetStr("unstructured body")
+ namespaced.Attributes().PutStr("service.name", "claude-code")
+ namespaced.Attributes().PutStr("event.name", "claude_code.future_lifecycle_event")
+ namespacedEvent := NewConverter(Options{}).EventFromLog(nil, namespaced)
+ if namespacedEvent.Event.Action != "session.activity" || namespacedEvent.Event.Category != "session" {
+ t.Fatalf("namespaced event = %#v, want safe session.activity fallback", namespacedEvent.Event)
+ }
}
func TestClaudeNormalizationPreservesExplicitClassification(t *testing.T) {