Skip to content

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

Remove unreachable branch in emitPreToolObserved

Cursor Agent536fbcf3afe5
diff --git a/cli/beacon-hooks/cmd/pre_tool.go b/cli/beacon-hooks/cmd/pre_tool.go
index 7d4d4108..fa7cb72d 100644
--- a/cli/beacon-hooks/cmd/pre_tool.go
+++ b/cli/beacon-hooks/cmd/pre_tool.go
@@ -1,8 +1,6 @@
package cmd
import (
- "strings"
-
"github.com/spf13/cobra"
"github.com/asymptote-labs/agent-beacon/cli/beacon-hooks/internal/logging"
@@ -76,18 +74,5 @@ func emitPreToolObserved(logger *logging.Logger, input map[string]interface{}, s
for key, value := range toolFields(toolName, toolInput) {
fields[key] = value
}
- action := "tool.invoked"
- category := "tool"
- if platformFlag != "devin" {
- action = actionForTool(getFirstStr(input, "hook_event_name"), toolName)
- switch {
- case strings.HasPrefix(action, "command."):
- category = "command"
- case strings.HasPrefix(action, "file."):
- category = "file"
- case strings.HasPrefix(action, "mcp."):
- category = "mcp"
- }
- }
- emitHookEvent(logger, action, category, "info", "Tool invocation observed", input, fields)
+ emitHookEvent(logger, "tool.invoked", "tool", "info", "Tool invocation observed", input, fields)
}