Skip to content

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

Add the Muse Code harness identity

Clauded9eec677a81a
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.go
index 61a882c5..7145a73d 100644
--- a/pkg/asymptoteobserve/harness.go
+++ b/pkg/asymptoteobserve/harness.go
@@ -123,6 +123,27 @@ func NormalizeHarnessName(name string) string {
lower == "qwencode" || lower == "qwen_cli" || lower == "qwen-cli" || lower == "qwen cli" ||
lower == "qwen_coder" || lower == "qwen-coder" || lower == "qwen coder":
return "qwen_code"
+ // Muse Code is Meta's terminal coding agent; Muse Spark is the model it runs. Beacon hooks the
+ // agent, so the harness is muse_code -- the canonical spelling follows claude_code and
+ // qwen_code, because Muse Code is the product's name rather than a CLI suffix.
+ //
+ // Muse Spark spellings are deliberately absent from this set, and that is the whole reason the
+ // case is written as equality against a closed set rather than Contains(lower, "muse"). Every
+ // Muse Spark model id begins with the same four letters the harness does -- muse-spark-1.2,
+ // muse-spark-1.3, muse-spark-1.2-contributor -- so a substring rule would report any event
+ // whose harness attribute happened to carry a model string as a Muse Code session. That is the
+ // Qwen failure exactly (see TestQwenModelNamesAreNotTreatedAsTheHarness), and here it would be
+ // worse: the model and the agent ship under one brand, so a reader seeing "muse_spark" in
+ // harness.name has no way to tell a misattributed model id from a real runtime. Leaving those
+ // spellings unmapped means they fall to the passthrough case below and show up as themselves,
+ // which is visible as an anomaly rather than silently filed under the agent.
+ //
+ // "muse" alone is also an ordinary English word, so the closed set is what keeps a harness
+ // attribute that merely contains it from being claimed. There is no prefix rule for the same
+ // reason: a future runtime named "musey" is not this one.
+ case lower == "muse" || lower == "muse_code" || lower == "muse-code" || lower == "muse code" ||
+ lower == "musecode" || lower == "muse_cli" || lower == "muse-cli" || lower == "muse cli":
+ return "muse_code"
// Prime Agent (Prime Intellect) ships the same extension API as Pi, which is why Beacon
// observes it the same way -- but it is a separate product, and recording its sessions as
// pi_cli would merge two runtimes' activity under one name in every query that groups by
diff --git a/pkg/asymptoteobserve/harness_test.go b/pkg/asymptoteobserve/harness_test.go
index 608fb8eb..ff470bc2 100644
--- a/pkg/asymptoteobserve/harness_test.go
+++ b/pkg/asymptoteobserve/harness_test.go
@@ -21,6 +21,7 @@ func TestHookPlatformsConvergeOnCanonicalNames(t *testing.T) {
"cline": "cline",
"qwen": "qwen_code",
"prime": "prime_agent",
+ "muse": "muse_code",
} {
t.Run(platform, func(t *testing.T) {
if got := NormalizeHarnessName(platform); got != want {
@@ -40,6 +41,7 @@ func TestCanonicalNamesAreStableUnderRenormalization(t *testing.T) {
"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", "omp", "cline", "qwen_code", "prime_agent", "vercel_fx",
+ "muse_code",
} {
t.Run(canonical, func(t *testing.T) {
if got := NormalizeHarnessName(canonical); got != canonical {
@@ -366,3 +368,57 @@ func TestFxIsNotAttributedToItsModelProviders(t *testing.T) {
t.Errorf("NormalizeHarnessName(%q) = %q, want codex_cli", "codex", got)
}
}
+
+// Muse Code reaches Beacon under more than one spelling for the same reason every other runtime
+// does: the hook path installs with --platform muse, while anything deriving a name from the
+// runtime's own strings reports what Meta calls the product. Pinning them here is what keeps one
+// Muse Code session from being recorded under two names.
+func TestMuseSpellingsConvergeOnMuseCode(t *testing.T) {
+ for _, in := range []string{
+ "muse", "Muse", "MUSE", " muse ", "muse_code", "muse-code", "Muse Code", "musecode",
+ "muse_cli", "muse-cli", "Muse CLI",
+ } {
+ t.Run(in, func(t *testing.T) {
+ if got := NormalizeHarnessName(in); got != "muse_code" {
+ t.Errorf("NormalizeHarnessName(%q) = %q, want %q", in, got, "muse_code")
+ }
+ })
+ }
+}
+
+// The reason the Muse case is an equality match rather than a Contains rule, and the sharpest
+// version of it in the whole function: Meta ships the agent (Muse Code) and the model it runs
+// (Muse Spark) under one brand, so every Muse Spark model id begins with the same four letters
+// the harness does. A Contains(lower, "muse") rule would report any event whose harness attribute
+// carried a model string as a Muse Code session -- and unlike the Qwen case, a reader seeing a
+// Muse-prefixed value in harness.name could not tell the misattribution from the real thing.
+//
+// Falling through to the passthrough case is the wanted behavior, not a gap: a model id that has
+// somehow reached harness.name shows up as itself, which is visible as an anomaly, rather than
+// being silently filed under the agent.
+func TestMuseSparkModelNamesAreNotTreatedAsTheHarness(t *testing.T) {
+ for _, name := range []string{
+ "muse-spark", "muse_spark", "muse-spark-1.2", "muse-spark-1.3",
+ "muse-spark-1.2-contributor", "Muse Spark 1.2",
+ } {
+ t.Run(name, func(t *testing.T) {
+ if got := NormalizeHarnessName(name); got == "muse_code" {
+ t.Errorf("NormalizeHarnessName(%q) = %q; a Muse Spark model id must not be "+
+ "reported as the Muse Code harness", name, got)
+ }
+ })
+ }
+}
+
+// "muse" is an ordinary English word and a substring of several others. The closed set is what
+// keeps a harness attribute that merely contains it from being claimed by this case.
+func TestOrdinaryWordsContainingMuseAreNotMuseCode(t *testing.T) {
+ for _, name := range []string{"amuse", "museum", "amusement", "musement", "bemuse"} {
+ t.Run(name, func(t *testing.T) {
+ if got := NormalizeHarnessName(name); got == "muse_code" {
+ t.Errorf("NormalizeHarnessName(%q) = %q; a word merely containing \"muse\" must "+
+ "not be reported as the Muse Code harness", name, got)
+ }
+ })
+ }
+}
diff --git a/pkg/asymptoteobserve/provenance_test.go b/pkg/asymptoteobserve/provenance_test.go
index d94d2580..c44d7c6a 100644
--- a/pkg/asymptoteobserve/provenance_test.go
+++ b/pkg/asymptoteobserve/provenance_test.go
@@ -105,6 +105,13 @@ func TestCollectionMethodForPlatform(t *testing.T) {
"hermes": CollectionMethodHook,
"factory": CollectionMethodHook,
"copilot": CollectionMethodHook,
+ // Muse Code is hook-shaped even though Beacon writes the whole hooks file rather than
+ // merging into one the vendor already has. The distinction this field draws is about what
+ // Beacon ships, not who owns the file: the events are Meta's own lifecycle events and the
+ // payloads are Meta's to change, so a coverage gap is the vendor's to expose. Grok is the
+ // 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,
// 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.