The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
feat(harness): recognize Oh My Pi as its own runtime
Claude913cb07d81c4
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.goindex 00c50ae7..f1d0df88 100644--- a/pkg/asymptoteobserve/harness.go+++ b/pkg/asymptoteobserve/harness.go@@ -58,6 +58,28 @@ func NormalizeHarnessName(name string) string {return "vscode_copilot"case strings.Contains(lower, "github-copilot") || strings.Contains(lower, "copilot_cli") || strings.Contains(lower, "copilot"):return "copilot_cli"+ // Oh My Pi (omp) is a separate product from Pi, not another Pi host, so it gets its own+ // canonical name rather than folding into pi_cli. It is a fork of pi-mono with its own binary+ // (`omp`), its own config root (`~/.omp`), its own npm package, and an event API Pi does not+ // have -- approval decisions among them. Recording both under one name would merge two+ // separately installed runtimes' activity in every query that groups by harness.name, which is+ // the one thing a security log must not do to two different products on the same machine.+ //+ // The canonical spelling is `omp` because that is what the user sees: the binary they run and+ // the directory Beacon installs into. `oh-my-pi` is the repository name, not the command.+ //+ // Equality against a closed set, like Pi below and for a sharper version of the same reason:+ // "omp" is three characters and sits inside ordinary words this field carries in practice --+ // "prompt" contains it, and so does any harness name containing "comp". A Contains rule would+ // report those as Oh My Pi sessions.+ //+ // Placed above the Pi case deliberately. Equality makes the order irrelevant today, but every+ // Oh My Pi spelling here ends in "pi", so if the Pi case were ever loosened to a substring+ // match, resolving Oh My Pi first is what keeps "oh-my-pi" from being recorded as Pi.+ case lower == "omp" || lower == "omp_cli" || lower == "omp-cli" || lower == "omp cli" ||+ lower == "oh-my-pi" || lower == "oh_my_pi" || lower == "ohmypi" || lower == "oh my pi" ||+ lower == "omp.sh":+ return "omp"// Pi is matched by equality against a fixed set of spellings, not by substring, because "pi" is// two characters and appears inside names that belong to other runtimes: "copilot" contains it,// so a Contains rule here would report every GitHub Copilot and VS Code Copilot session as Pi.diff --git a/pkg/asymptoteobserve/harness_test.go b/pkg/asymptoteobserve/harness_test.goindex 97e394f1..efe5df4a 100644--- a/pkg/asymptoteobserve/harness_test.go+++ b/pkg/asymptoteobserve/harness_test.go@@ -17,6 +17,7 @@ func TestHookPlatformsConvergeOnCanonicalNames(t *testing.T) {"antigravity": "antigravity_cli","vscode": "vscode_copilot","pi": "pi_cli",+ "omp": "omp","cline": "cline","qwen": "qwen_code",} {@@ -37,7 +38,7 @@ func TestCanonicalNamesAreStableUnderRenormalization(t *testing.T) {for _, canonical := range []string{"claude_code", "codex_cli", "gemini_cli", "antigravity_cli", "vscode_copilot","copilot_cli", "claude_web", "chatgpt_web", "claude_cowork", "claude_agent_sdk",- "openclaw_gateway", "pi_cli", "cline", "qwen_code",+ "openclaw_gateway", "pi_cli", "omp", "cline", "qwen_code",} {t.Run(canonical, func(t *testing.T) {if got := NormalizeHarnessName(canonical); got != canonical {@@ -113,6 +114,56 @@ func TestNamesMerelyStartingWithPiAreNotPi(t *testing.T) {}}+// Oh My Pi's canonical name is reachable from the spellings the two write paths produce: the hook+// path installs with --platform omp, and the OTLP path would read a service.name that could just+// as easily be the repository name.+func TestOmpSpellingsConvergeOnOmp(t *testing.T) {+ for _, in := range []string{+ "omp", "OMP", " omp ", "omp_cli", "omp-cli", "omp cli",+ "oh-my-pi", "oh_my_pi", "ohmypi", "Oh My Pi", "omp.sh",+ } {+ t.Run(in, func(t *testing.T) {+ if got := NormalizeHarnessName(in); got != "omp" {+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q", in, got, "omp")+ }+ })+ }+}++// "omp" is three characters and sits inside ordinary words that reach this field, so matching it by+// substring would attribute unrelated runtimes to Oh My Pi. "prompt" is the concrete case: it+// appears in harness and service names across this codebase. This test is what keeps the Oh My Pi+// case an equality match.+func TestOmpDoesNotSwallowNamesContainingOmp(t *testing.T) {+ for _, name := range []string{"prompt-runner", "compass", "comp-agent", "ompa-cli"} {+ if got := NormalizeHarnessName(name); got != name {+ t.Errorf("NormalizeHarnessName(%q) = %q, want it preserved -- a substring rule for "++ "Oh My Pi would reassign this runtime's sessions to omp", name, got)+ }+ }+}++// Oh My Pi and Pi are separate products that a fleet can have installed side by side, and every Oh+// My Pi spelling ends in "pi". Neither may resolve to the other: merging them would attribute one+// runtime's commands, edits and approvals to the other in every harness-grouped query.+func TestOmpAndPiStaySeparateRuntimes(t *testing.T) {+ for name, want := range map[string]string{+ "oh-my-pi": "omp",+ "oh_my_pi": "omp",+ "omp": "omp",+ "pi": "pi_cli",+ "pi.dev": "pi_cli",+ "pi_cli": "pi_cli",+ } {+ t.Run(name, func(t *testing.T) {+ if got := NormalizeHarnessName(name); got != want {+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q -- Oh My Pi and Pi must not be "++ "recorded under one name", name, got, want)+ }+ })+ }+}+// Cline's canonical name has to be reachable from every spelling its hosts produce. It runs as a// VS Code extension, a JetBrains plugin and a CLI over one agent core, so the hook path// (--platform cline) and an OTLP service.name can each report a different capitalization ordiff --git a/pkg/asymptoteobserve/provenance.go b/pkg/asymptoteobserve/provenance.goindex 81da922a..a1a75c3a 100644--- a/pkg/asymptoteobserve/provenance.go+++ b/pkg/asymptoteobserve/provenance.go@@ -96,7 +96,7 @@ func CollectionMethodForPlatform(platform string) string {switch strings.ToLower(strings.TrimSpace(platform)) {case "":return ""- case "opencode", "cline", "pi":+ case "opencode", "cline", "pi", "omp":return CollectionMethodPlugindefault:return CollectionMethodHookdiff --git a/pkg/asymptoteobserve/provenance_test.go b/pkg/asymptoteobserve/provenance_test.goindex ccaefa71..9e953776 100644--- a/pkg/asymptoteobserve/provenance_test.go+++ b/pkg/asymptoteobserve/provenance_test.go@@ -113,6 +113,7 @@ func TestCollectionMethodForPlatform(t *testing.T) {"opencode": CollectionMethodPlugin,"cline": CollectionMethodPlugin,"pi": CollectionMethodPlugin,+ "omp": CollectionMethodPlugin,// Unset stays unset rather than defaulting to a method, so an event with no platform does// not claim one."": "",