Files
magpie/internal/settings
yetone f3ad175fb2 library: an MCP server's sign-in keeps to its link when Settings say so (hkxhkxhkx on X)
hkxhkxhkx asked for magpie never to open OAuth pages in the browser on
its own. Settings › Privacy › Sign-in pages › "Open sign-in pages in the
browser" (signInLinkOnly, since a45a0f1c5) already does that for every
account's sign-in, built-in and plugin, in the window, a web tab and the
command line (`magpie accounts add`, a plugin's login; `magpie settings
set signInLinkOnly true` sets it there). Audit of every route that opens a
sign-in page: the one it missed is an MCP server's OAuth sign-in from the
Library, which /api/library/mcp-signin opened in the default browser
whatever the setting. The TUI starts no sign-in; `magpie web` opens
magpie's own page (it has --no-open), not a vendor's.

Now /api/library/mcp-signin goes through openMCPSignIn: with the setting
on it opens nothing and answers linkOnly. The Library opens no tab of its
own on linkOnly (web), opens the server's editor from a row's sign-in, and
shows the same words as an account's link-only sign-in, the link with Copy,
and Open in browser. No new strings.

Still opened whatever the setting: a plugin whose own sign-in opens the
page or a Chrome window (Grok Build's CLI on macOS and Windows; agnes,
inkstone, astudio, mclaw, sensenova drive Chrome to sign in).

Run (Linux, magpie-desktop via wsl-run; mote was over its load the whole
time with eight full suites queued, mica's disk full):
- TestMCPSignInLinkOnlyOpensNothing (new), TestSignInLinkOnlyOpensNothing,
  TestMCPSignInSaysTheBrowserDidntOpen, TestOpenSignInLinkOnlyAsked,
  TestCoreScriptBudget, TestI18n* (-tags nogui): ok.
- mcp-signin-link-only.test.cjs (new; en, zh, zh-TW, ja, de; desktop and
  web; 1100 and 420px; Chromium and WebKit) with signin-browser-down,
  mcp-signin, mcp-signin-click, mcp-accounts, signin-link-only and
  i18n-keys: 146/146.
Broken by hand: the route back on openError, the new Go test red ("its
page was opened 1 times"); client.js back to main's, the new GUI test red
(no link-only note).
Not tried: a real MCP server's sign-in in the app; the whole GUI suite;
the full Go suite before the push (started after it).
2026-11-13 15:13:13 +08:00
..