Commit Graph
1 Commits
Author SHA1 Message Date
yetone 4cd01c964a agent: a Linux link handler counts only when its desktop entry and program are there (geddy)
geddy (X, 2117406492832010548) added magpie to Cindy on Omarchy: a blank
Chrome tab opened and magpie said it was handed to Cindy. On Linux,
systemLinkHandler took any answer from `xdg-mime query default
x-scheme-handler/cindy` as "found". xdg-utils 1.2.1 (Arch) checks that the
entry exists only for mimeapps.list; a stale line in mimeinfo.cache or
defaults.list comes back as a name with nothing behind it. xdg-open then
can't find the entry and falls back to $BROWSER / chromium, which is the
blank tab.

Now the name xdg-mime gives is looked up in every XDG data dir's
applications/ (with the dash-as-subfolder variants), and its Exec program
must be there (absolute and present, or on PATH). With no entry, the gone
path goes to OpenAppLink, which returns NoLinkHandlerError ("Cindy's links
(cindy://) open …/applications/cindy.desktop, which isn't there") instead
of opening anything. A read error other than not-exist is returned as
unknown. desktopExec (Lody) now shares the same parse (desktopArgs) and
the XDG dir list.

What was run:
- TestDesktopHandlerNeedsItsEntryAndProgram (new) and -run
  'Desktop|OpenAppLink|Lody|CommandProgram' on mote (macOS) and Linux
  (wsl-run, magpie-desktop, Go 1.26.8): ok.
- Real xdg-mime on Linux in a temp HOME, XDG_CURRENT_DESKTOP=Hyprland, a
  stale `x-scheme-handler/cindy=cindy.desktop;` in mimeinfo.cache and no
  entry: origin/main said found and handed the link to xdg-open; this
  change returns the error above.
- Broken by hand: returning found with no entry turns the new test red.
- gofmt -l clean; GOOS=linux go vet -tags nogui and GOOS=windows go vet
  of ./internal/agent on mote: ok.
- go test ./... on Linux: every package ok except reds that fail the same
  at base c86fa2a34 on that box: 7 internal/agent install-detection
  tests (#4033; TestHowInstalled fails at base too with -count=3),
  TestCodexPoolSaysTheClientsVersion (#4807), TestCCListingKeepsItsNames
  (#4925). Root, internal/cli and internal/gui need GTK4 there, so they
  ran again with -tags nogui: all three ok.
- Rebased on 1a92a97ca (5 commits, internal/agent's Claude Desktop
  models among them): internal/agent on Linux again, only #4033's
  install-detection reds.

Not tried: a real Omarchy VM (its Hyper-V adapter had no IP, ssh was
refused) and a real Cindy install on Linux.
2026-11-03 09:50:31 +08:00