Skip to content

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

Fix HasPromptLikeContent treating empty input messages as prompt

Cursor Agent6e40c27ce35b
diff --git a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
index 3fc56ad5..6e273fcc 100644
--- a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
+++ b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
@@ -1096,7 +1096,7 @@ func HasPromptLikeContent(attrs map[string]interface{}) bool {
if FirstString(attrs, "gen_ai.prompt", "prompt", "user_prompt", "input.prompt", "copilot_chat.user_request") != "" {
return true
}
- if _, ok := AnyAttr(attrs, "gen_ai.input.messages"); ok {
+ if v, ok := AnyAttr(attrs, "gen_ai.input.messages"); ok && firstTextFromAny(v) != "" {
return true
}
return len(LegacyMessages(attrs, "gen_ai.prompt.", "user")) > 0