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): pin `cline` as Cline's canonical harness name
Claudeae319bff888a
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.goindex 2df894d5..b483b0df 100644--- a/pkg/asymptoteobserve/harness.go+++ b/pkg/asymptoteobserve/harness.go@@ -71,6 +71,20 @@ func NormalizeHarnessName(name string) string {case lower == "pi" || lower == "pi.dev" || lower == "pi_cli" || lower == "pi-cli" ||lower == "pi_agent" || lower == "pi-agent" || lower == "pi agent":return "pi_cli"+ // Cline reaches Beacon from more than one host -- a VS Code extension, a JetBrains plugin and a+ // CLI, all over the same agent core -- so the spelling that arrives depends on which host+ // reported it. Pinning the canonical name here is what keeps one Cline session from being+ // recorded under two names when the hook path (`--platform cline`) and an OTLP resource+ // attribute disagree about capitalization or suffix.+ //+ // Equality against a closed set, like Pi above and unlike the Contains rules further up.+ // "cline" is a substring of Cline's own configuration names -- `.clinerules` is a directory+ // every Cline user has -- so a Contains rule here would claim any harness whose name merely+ // mentioned one of those paths. The set is closed rather than a prefix rule for the same+ // reason.+ case lower == "cline" || lower == "cline_cli" || lower == "cline-cli" || lower == "cline cli" ||+ lower == "cline.bot":+ return "cline"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.goindex f6881e81..5a32ebd2 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",+ "cline": "cline",} {t.Run(platform, func(t *testing.T) {if got := NormalizeHarnessName(platform); got != want {@@ -35,7 +36,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",+ "openclaw_gateway", "pi_cli", "cline",} {t.Run(canonical, func(t *testing.T) {if got := NormalizeHarnessName(canonical); got != canonical {@@ -111,6 +112,47 @@ func TestNamesMerelyStartingWithPiAreNotPi(t *testing.T) {}}+// 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 or+// suffix for the same session.+func TestClineSpellingsConvergeOnCline(t *testing.T) {+ for _, in := range []string{+ "cline", "Cline", "CLINE", " cline ", "cline_cli", "cline-cli", "cline cli", "cline.bot",+ } {+ t.Run(in, func(t *testing.T) {+ if got := NormalizeHarnessName(in); got != "cline" {+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q", in, got, "cline")+ }+ })+ }+}++// "cline" appears inside names Cline itself puts on disk: every Cline user has a `.clinerules`+// directory, and a harness reporting a name derived from one of those paths must keep it rather+// than being recorded as Cline activity. This is what keeps the Cline case an equality match+// rather than a Contains rule.+func TestClineDoesNotSwallowNamesMentioningCline(t *testing.T) {+ for _, name := range []string{".clinerules", "clinerules", "clinerules-sync", "decline-bot"} {+ if got := NormalizeHarnessName(name); got != name {+ t.Errorf("NormalizeHarnessName(%q) = %q, want it preserved", name, got)+ }+ }+}++// Cline is not a Claude surface. The generic `Contains(lower, "claude")` rule above returns+// claude_code for anything it can see the word "claude" in, and the two product names are close+// enough in writing that a future edit could plausibly route one through the other -- which would+// file Cline sessions as Claude Code sessions in every dashboard and detection that groups by+// harness.name.+func TestClineIsNotAttributedToClaudeCode(t *testing.T) {+ for _, in := range []string{"cline", "Cline", "cline_cli", "cline.bot"} {+ if got := NormalizeHarnessName(in); got == "claude_code" {+ t.Errorf("NormalizeHarnessName(%q) = %q, want Cline to keep its own harness", in, got)+ }+ }+}+// An unrecognized runtime keeps its own name. Coercing it to "unknown" would erase the one clue// available when a new harness starts reporting, and these names reach customer dashboards.func TestUnknownRuntimesKeepTheirName(t *testing.T) {