Skip to content

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

Add the openhands harness identity

Claude44bcf8364718
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.go
index 7145a73d..d7829148 100644
--- a/pkg/asymptoteobserve/harness.go
+++ b/pkg/asymptoteobserve/harness.go
@@ -177,6 +177,27 @@ func NormalizeHarnessName(name string) string {
lower == "fx.sh" || lower == "vercel_fx" || lower == "vercel-fx" || lower == "vercel fx" ||
lower == "vercel fx cli" || lower == "fx_agent" || lower == "fx-agent":
return "vercel_fx"
+ // OpenHands (formerly All Hands AI) is matched by equality against a closed set for the same
+ // reason Qwen Code and Muse Code are, and it is the Muse case exactly: the same organization
+ // ships the agent and a model family under one name, so every OpenHands LM model id begins
+ // with the letters the harness does -- openhands-lm-32b-v0.1, openhands-lm-7b-v0.1. A
+ // Contains(lower, "openhands") rule would report any event whose harness attribute happened to
+ // carry one of those model strings as an OpenHands session, and a reader could not tell the
+ // misattribution from the real thing because both start with the same word.
+ //
+ // Model spellings are therefore deliberately left out of the set: they fall to the passthrough
+ // case and show up as themselves, which is visible as an anomaly rather than silently filed
+ // under the agent.
+ //
+ // The canonical spelling is plain `openhands` rather than `openhands_cli`, because OpenHands
+ // is one product that runs the same agent in Cloud, the CLI and the local GUI -- Beacon hooks
+ // all three through the same `.openhands/hooks.json`, so a CLI suffix would name only one of
+ // the places the events come from. It follows `cline` and `omp`, not `codex_cli`.
+ case lower == "openhands" || lower == "open_hands" || lower == "open-hands" || lower == "open hands" ||
+ lower == "openhands_cli" || lower == "openhands-cli" || lower == "openhands cli" ||
+ lower == "openhands_agent" || lower == "openhands-agent" || lower == "openhands agent" ||
+ lower == "openhands.dev":
+ return "openhands"
case name != "":
// An unrecognized runtime keeps its own name rather than being coerced or dropped. A new
// harness should show up in the log as itself, not as "unknown".
diff --git a/pkg/asymptoteobserve/harness_test.go b/pkg/asymptoteobserve/harness_test.go
index ff470bc2..48d32768 100644
--- a/pkg/asymptoteobserve/harness_test.go
+++ b/pkg/asymptoteobserve/harness_test.go
@@ -422,3 +422,74 @@ func TestOrdinaryWordsContainingMuseAreNotMuseCode(t *testing.T) {
})
}
}
+
+func TestOpenHandsSpellingsConvergeOnOpenHands(t *testing.T) {
+ for _, in := range []string{
+ "openhands", "OpenHands", "OPENHANDS", " openhands ", "open_hands", "open-hands",
+ "Open Hands", "openhands_cli", "openhands-cli", "OpenHands CLI", "openhands_agent",
+ "openhands-agent", "OpenHands Agent", "openhands.dev",
+ } {
+ t.Run(in, func(t *testing.T) {
+ if got := NormalizeHarnessName(in); got != "openhands" {
+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q", in, got, "openhands")
+ }
+ })
+ }
+}
+
+// The reason the OpenHands case is an equality match rather than a Contains rule. The same
+// organization publishes the agent and the OpenHands LM model family, so every one of those model
+// ids begins with the word the harness does; a substring rule would report an event whose harness
+// attribute carried a model string as an OpenHands session, and the value would look plausible
+// either way. Falling through to the passthrough case is the wanted behavior: the model id shows
+// up as itself, which reads as an anomaly rather than as the agent.
+func TestOpenHandsModelNamesAreNotTreatedAsTheHarness(t *testing.T) {
+ for _, name := range []string{
+ "openhands-lm", "openhands-lm-32b", "openhands-lm-32b-v0.1", "openhands-lm-7b-v0.1",
+ "all-hands/openhands-lm-32b-v0.1", "OpenHands LM 32B",
+ } {
+ t.Run(name, func(t *testing.T) {
+ if got := NormalizeHarnessName(name); got == "openhands" {
+ t.Errorf("NormalizeHarnessName(%q) = %q; an OpenHands LM model id must not be "+
+ "reported as the OpenHands harness", name, got)
+ }
+ })
+ }
+}
+
+// "hands" is an ordinary English word and "open" prefixes several unrelated product names, so the
+// closed set is what keeps a harness attribute that merely contains either from being claimed.
+func TestOrdinaryNamesContainingOpenOrHandsAreNotOpenHands(t *testing.T) {
+ for _, name := range []string{
+ "openai", "opencode", "openclaw", "open-interpreter", "handsfree", "hands",
+ "openhands-runtime-sandbox",
+ } {
+ t.Run(name, func(t *testing.T) {
+ if got := NormalizeHarnessName(name); got == "openhands" {
+ t.Errorf("NormalizeHarnessName(%q) = %q; a name merely containing \"open\" or "+
+ "\"hands\" must not be reported as the OpenHands harness", name, got)
+ }
+ })
+ }
+}
+
+// opencode resolves before anything OpenHands-shaped could claim it. Both start with "open", both
+// are hook-installable runtimes Beacon supports, and recording one under the other's name would
+// merge two separately installed products in every query that groups by harness.name.
+func TestOpenHandsAndOpenCodeStaySeparateRuntimes(t *testing.T) {
+ if got := NormalizeHarnessName("openhands"); got != "openhands" {
+ t.Fatalf("NormalizeHarnessName(openhands) = %q, want openhands", got)
+ }
+ if got := NormalizeHarnessName("opencode"); got == "openhands" {
+ t.Fatalf("NormalizeHarnessName(opencode) = %q; opencode must not resolve to openhands", got)
+ }
+}
+
+// The normalized name is itself a spelling this function accepts, so a row read out of the runtime
+// log and fed back in resolves to the same harness rather than drifting to a second name.
+func TestOpenHandsCanonicalNameIsStableUnderRenormalization(t *testing.T) {
+ once := NormalizeHarnessName("openhands-cli")
+ if got := NormalizeHarnessName(once); got != once {
+ t.Fatalf("NormalizeHarnessName(%q) = %q, want %q", once, got, once)
+ }
+}
diff --git a/pkg/asymptoteobserve/provenance_test.go b/pkg/asymptoteobserve/provenance_test.go
index c44d7c6a..7a45e2d7 100644
--- a/pkg/asymptoteobserve/provenance_test.go
+++ b/pkg/asymptoteobserve/provenance_test.go
@@ -112,6 +112,12 @@ func TestCollectionMethodForPlatform(t *testing.T) {
// same shape for the same reason. A `plugin` here would claim Beacon ships and versions
// source the runtime loads, which for Muse Code it does not.
"muse": CollectionMethodHook,
+ // OpenHands is hook-shaped: the events, the payload shapes and the .openhands/hooks.json
+ // contract are all the vendor's, and Beacon only registers commands in a file the runtime
+ // already reads. A `plugin` here would claim Beacon ships and versions source OpenHands
+ // loads, which it does not -- and would send someone to fix Beacon for a field OpenHands
+ // never sent.
+ "openhands": CollectionMethodHook,
// vscode is the case that justifies keying on --platform rather than on the normalized
// harness name: its hook and OTLP telemetry both normalize to vscode_copilot, so the
// harness name cannot distinguish them and only the flag can.