Files
magpie/docs
yetone 2e2c890304 agent: Lody is detected by what Lody makes, its link only on loopback is guarded, and its row is tested in every language
Review of Leon Zhao's Lody import (the two commits before this):

- Detection: a bare ~/.lody or ~/.lody-oss another tool made counted as
  Lody. Now the home folder counts only with an entry Lody makes there
  (workspace-catalog.json, loro-repo, agent-binaries, code-collab-v2, all
  in the owner's real ~/.lody). A Lody.app counts only with an ai.lody.
  bundle id (the real /Applications/Lody.app is ai.lody.desktop, and
  registers the lody scheme) or a plist that isn't XML. Electron's data
  folder under os.UserConfigDir (Application Support / %APPDATA% /
  ~/.config, "Lody", "Lody OSS", "Lody Nightly") still counts as before.
  A never-opened install on Windows or Linux has no folder and isn't
  shown; said in agent-wiring.md.
- Security: TestLodyLinkCarriesNoSecret turns LAN sharing on and checks
  the link holds magpie-lody and never the LAN key, every endpoint is
  loopback http, and MAGPIE_ADDR pinned beyond loopback gives no link at
  all (0.0.0.0, 127.0.0.1 and [::1] still give one).
- `magpie lody add` with no link (a LAN-pinned gateway) said it opened
  Lody and opened ""; it now says why and opens nothing.
- Added *bool: every consumer re-read. The CLI and TUI use agent.Agent's
  func (nil-safe), the GUI reads a.added == null, and Cindy's false is now
  sent as "added":false. TestLodyImportHandoff also checks Cindy's row
  says false and Lody's leaves added out; the handoff test's ~/.lody
  holds a catalog file now and checks it is left byte for byte.
- The hint "Opens {name} to add magpie as a provider — confirm it there"
  was already translated in zh, zh-TW, ja and de (the import button's
  tooltip). import-row now runs in all five languages, asserts Lody's
  exact translated line and that no added/not-added wording shows, and
  checks both import rows fit a 420px window with no sideways scroll
  (waiting for the header's segments to settle after the resize, which
  overflow for ~300ms in WebKit en on main too).

Run (on origin/main 4a6bf80f4 + Leon's two; after rebasing onto
dcf292cc8, a routing-only CSS change, import-row, agent-layout,
group-editor-align and i18n-keys were run again in both engines, 47/47,
with the Lody/Cindy/Import Go tests in agent and gui, ok):
- go test -tags nogui -count=1 -timeout 45m ./... under a sandbox HOME
  (scratchpad dir, XDG_* there too, Go caches pinned): 64 packages ok,
  exit 0 (agent 607s, gateway 674s, gui 130s, provider 219s).
- gofmt -l .: clean. go vet: darwin ./..., GOOS=linux -tags nogui ./...,
  GOOS=windows ./...: clean.
- GUI, playwright 1.62.0, Chromium and WebKit: import-row 20/20 (5
  languages x added/not x 2 engines, 960/700/420px); i18n-keys, gui-de,
  gui-ja, gui-zh-tw, agent-layout, agent-connect, plugin-agent,
  agent-cli-missing, agent-connected-unfolded, agent-bulk-visibility,
  agents-hidden-last: 116/116.

Broken by hand, each went red, then restored:
- a bare ~/.lody counting again: TestLodyDetectionAndRegistration;
- any Lody.app counting: TestLodyBundle (com.example.lody, ai.lodyx.);
- the loopback switch removed: TestLodyLinkCarriesNoSecret (LAN-pinned
  addresses got a link);
- the key taken from agentKeyAt at a LAN address: the LAN key showed in
  the link, red;
- Cindy's false left out of state(): TestLodyImportHandoff;
- app.js's unknown-status branch taken out: import-row red in every
  language; the de translation removed: import-row de red.

Not tried: Lody opening the link for real (Leon ran Lody's parser), and
Windows or Linux Lody installs.
2026-10-15 21:21:42 +08:00
..