Skip to content

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

handoff: file Devin CLI under the harness its hooks record

Claudee2a4cfc22f6a
diff --git a/cli/beacon/cmd/handoff.go b/cli/beacon/cmd/handoff.go
index fa0d9c8c..ecda3eb1 100644
--- a/cli/beacon/cmd/handoff.go
+++ b/cli/beacon/cmd/handoff.go
@@ -164,10 +164,8 @@ func loadHandoffBrief(id string) (handoff.Brief, error) {
// handoffLogReason says why a session was read from the runtime log.
func handoffLogReason(session handoff.Session) string {
- for _, harness := range handoff.Harnesses {
- if harness == session.Harness {
- return fmt.Sprintf("%s session %s is no longer in its runtime's store", session.Harness, session.ID)
- }
+ if handoff.ReadsStore(session.Harness) {
+ return fmt.Sprintf("%s session %s is no longer in its runtime's store", session.Harness, session.ID)
}
return fmt.Sprintf("beacon handoff does not read %s session stores", session.Harness)
}
diff --git a/cli/beacon/cmd/handoff_test.go b/cli/beacon/cmd/handoff_test.go
index b193e800..b75663e5 100644
--- a/cli/beacon/cmd/handoff_test.go
+++ b/cli/beacon/cmd/handoff_test.go
@@ -528,3 +528,15 @@ func TestDescribeHandoffPlanShowsTheEnvironment(t *testing.T) {
t.Fatalf("a plan with no overrides shows no env line: %q", out.String())
}
}
+
+func TestHandoffLogReasonNamesRuntimesWithoutAStore(t *testing.T) {
+ gone := handoffLogReason(handoff.Session{Harness: handoff.HarnessClaude, ID: "c-1"})
+ if !strings.Contains(gone, "no longer in its runtime's store") {
+ t.Fatalf("store-backed runtime: %q", gone)
+ }
+ for _, harness := range []string{handoff.HarnessGoose, "cursor"} {
+ if got := handoffLogReason(handoff.Session{Harness: harness, ID: "s-1"}); !strings.Contains(got, "does not read "+harness+" session stores") {
+ t.Fatalf("%s: %q", harness, got)
+ }
+ }
+}
diff --git a/cli/beacon/internal/handoff/brief_test.go b/cli/beacon/internal/handoff/brief_test.go
index 55e3bd27..1e13c264 100644
--- a/cli/beacon/internal/handoff/brief_test.go
+++ b/cli/beacon/internal/handoff/brief_test.go
@@ -471,3 +471,26 @@ func TestLogSessionAcceptsAUniquePrefix(t *testing.T) {
t.Fatalf("--harness must narrow the prefix (raw \"claude\" rows included): %+v, %v, %v", session, found, err)
}
}
+
+// A log row names a runtime by whatever spelling its hooks wrote; the session takes the registry's
+// harness, so it continues in its own runtime and --harness finds it.
+func TestLogSessionCanonicalizesAnAliasedHarness(t *testing.T) {
+ line := func(harness, id string) string {
+ return `{"timestamp":"2026-09-25T09:00:00Z","vendor":"beacon","product":"endpoint-agent","schema_version":"1.0","event":{"kind":"agent_runtime","action":"prompt.submitted","category":"prompt"},"severity":"info","endpoint":{"hostname":"h","os":"linux"},"harness":{"name":"` + harness + `"},"session":{"id":"` + id + `"},"prompt":{"text":"p ` + id + `"}}`
+ }
+ logPath := filepath.Join(t.TempDir(), "runtime.jsonl")
+ writeFixture(t, logPath, strings.Join([]string{
+ line("devin-cli", "devin-new-123"),
+ line("devin", "devin-old-456"),
+ }, "\n")+"\n")
+ for _, id := range []string{"devin-new-123", "devin-old-456"} {
+ session, _, found, err := LogSession(logPath, id, "")
+ if err != nil || !found || session.Harness != HarnessDevin {
+ t.Fatalf("%s: harness = %q, %v, %v; want %s", id, session.Harness, found, err, HarnessDevin)
+ }
+ }
+ session, _, found, err := LogSession(logPath, "devin-old", HarnessDevin)
+ if err != nil || !found || session.ID != "devin-old-456" {
+ t.Fatalf("--harness must find rows written under the alias: %+v, %v, %v", session, found, err)
+ }
+}
diff --git a/cli/beacon/internal/handoff/runtimelog.go b/cli/beacon/internal/handoff/runtimelog.go
index 51909cb4..e8c6ebbc 100644
--- a/cli/beacon/internal/handoff/runtimelog.go
+++ b/cli/beacon/internal/handoff/runtimelog.go
@@ -32,8 +32,9 @@ func LogSession(logPath, id, harness string) (session Session, events []schema.E
}
session = Session{
ID: detail.Session.ID,
- // Older log rows carry a runtime's raw name ("claude"); every comparison uses the canonical one.
- Harness: asymptoteobserve.NormalizeHarnessName(detail.Session.Harness),
+ // Older log rows carry a runtime's raw name ("claude", "devin"); every comparison uses the
+ // canonical one.
+ Harness: canonicalHarness(asymptoteobserve.NormalizeHarnessName(detail.Session.Harness)),
Directory: detail.Session.WorkingDir,
Branch: detail.Session.Branch,
}
@@ -59,7 +60,7 @@ func logSessionForPrefix(logPath, prefix, harness string) (string, error) {
if event.Session == nil || !strings.HasPrefix(event.Session.ID, prefix) {
return nil
}
- name := asymptoteobserve.NormalizeHarnessName(event.Harness.Name)
+ name := canonicalHarness(asymptoteobserve.NormalizeHarnessName(event.Harness.Name))
if harness != "" && name != harness {
return nil
}
diff --git a/cli/beacon/internal/handoff/runtimes.go b/cli/beacon/internal/handoff/runtimes.go
index 496ff434..c23c418d 100644
--- a/cli/beacon/internal/handoff/runtimes.go
+++ b/cli/beacon/internal/handoff/runtimes.go
@@ -60,7 +60,7 @@ const (
HarnessQwen = "qwen_code"
HarnessKiro = "kiro"
HarnessAntigravity = "antigravity_cli"
- HarnessDevin = "devin"
+ HarnessDevin = "devin-cli"
HarnessMuse = "muse_code"
HarnessOpenHands = "openhands"
HarnessGoose = "goose"
@@ -220,7 +220,9 @@ var runtimes = []Runtime{
{
Harness: HarnessDevin,
Label: "Devin CLI",
- Aliases: []string{"devin-cli"},
+ // Beacon's Devin CLI hooks record "devin-cli"; hooks written by older versions recorded
+ // "devin", which reaches this entry through its alias.
+ Aliases: []string{"devin"},
// DEVIN_PERMISSION_MODE can hold "dangerous", which approves every tool; the flag wins over
// it. Devin reads a bare argument as a path to open, so the prompt follows --.
Command: &runtimeCommand{
@@ -266,6 +268,28 @@ var Harnesses = func() []string {
return names
}()
+// ReadsStore reports whether Beacon reads harness's own session store.
+func ReadsStore(harness string) bool {
+ r, ok := LookupRuntime(harness)
+ return ok && r.NewSource != nil
+}
+
+// canonicalHarness is the registry's harness for a name a log row carries: the name itself, or the
+// runtime it is an alias of. A name no runtime answers to is returned as it is.
+func canonicalHarness(name string) string {
+ if _, ok := LookupRuntime(name); ok {
+ return name
+ }
+ for _, r := range runtimes {
+ for _, alias := range r.Aliases {
+ if name == alias {
+ return r.Harness
+ }
+ }
+ }
+ return name
+}
+
// LookupRuntime returns the registry entry for harness.
func LookupRuntime(harness string) (Runtime, bool) {
for _, r := range runtimes {