Skip to content

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

fix typing

Justin D'Souzadc1f3e6e02bc
diff --git a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
index 86761268..3fc56ad5 100644
--- a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
+++ b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
@@ -745,7 +745,15 @@ func FirstNonEmpty(values ...string) string {
func IntAttr(attrs map[string]interface{}, keys ...string) (int, bool) {
value, ok := Int64Attr(attrs, keys...)
- return int(value), ok
+ if !ok {
+ return 0, false
+ }
+ maxInt := int64(^uint(0) >> 1)
+ minInt := -maxInt - 1
+ if value < minInt || value > maxInt {
+ return 0, false
+ }
+ return int(value), true
}
func Int64Attr(attrs map[string]interface{}, keys ...string) (int64, bool) {