[object Object]

← back to Ticket System

beacon: filter dead-tty ghost orange dots so screen-1 PASTE beacon reflects only live sessions (Cody TK-11693)

ae3c0a34008249b3067e0475fa1985b3252e6502 · 2026-09-13 23:46:17 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3N4rPMPvxXqQPbpQfHorw

Files touched

Diff

commit ae3c0a34008249b3067e0475fa1985b3252e6502
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun Sep 13 23:46:17 2026 -0700

    beacon: filter dead-tty ghost orange dots so screen-1 PASTE beacon reflects only live sessions (Cody TK-11693)
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Q3N4rPMPvxXqQPbpQfHorw
---
 desktop-bar/TicketBar.swift | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/desktop-bar/TicketBar.swift b/desktop-bar/TicketBar.swift
index 8871ca6f..2e7fba9c 100644
--- a/desktop-bar/TicketBar.swift
+++ b/desktop-bar/TicketBar.swift
@@ -606,12 +606,16 @@ private final class BarController: NSObject, NSApplicationDelegate, NSWindowDele
     for dir in dirs {
       guard let items = try? fm.contentsOfDirectory(at: dir, includingPropertiesForKeys: nil) else { continue }
       for url in items where url.pathExtension == "dot" {
+        let tty = url.deletingPathExtension().lastPathComponent
+        // Liveness filter (TK-11693, Cody review): a dead session leaves its .dot
+        // file behind, so a stale orange dot would pin the beacon on forever and it
+        // could never hide. Skip any dot whose owning pty device no longer exists.
+        guard fm.fileExists(atPath: "/dev/\(tty)") else { continue }
         guard let raw = try? String(contentsOf: url, encoding: .utf8) else { continue }
         let content = raw.trimmingCharacters(in: .whitespacesAndNewlines)
         guard content.hasPrefix("🟠") else { continue }
         var label = String(content.dropFirst()).trimmingCharacters(in: .whitespacesAndNewlines)
         if label.hasPrefix("🛑") { label = String(label.dropFirst()).trimmingCharacters(in: .whitespacesAndNewlines) }
-        let tty = url.deletingPathExtension().lastPathComponent
         found.append(OrangeDot(tty: tty, label: label.isEmpty ? tty : label))
       }
     }

← e23cf51b desktop-bar: add screen-1 PASTE beacon panel that mirrors an  ·  back to Ticket System  ·  TK-11676: mechanically cap masterdot-* tk-new authority (ded 30a93d61 →