ac4af582301a4e8a29245dbba767eba31334ddf9
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d1f8d8aae7 |
agent: Cherry Studio adds magpie through its providers link (plugins#865)
Cherry Studio (CherryHQ) shows on the Agents page, and with
`magpie cherrystudio`, on macOS, Windows and Linux. Its row is the link
its main process takes, cherrystudio://providers/api-keys?v=1&data=, with
the gateway at <gw>/v1 as an OpenAI-compatible provider named magpie and
the named key agentKeyAt("cherrystudio"). Cherry Studio asks the user to
confirm it. magpie writes nothing into its store. "Added" is read
untouched from its 2.x database (Data/cherrystudio.sqlite, user_provider),
in the default userData and every one boot-config.json moved it to. A
database or boot-config that can't be read, or a 1.x userData (Local
Storage, no database), is unknown. The data is standard base64, because
Cherry Studio swaps raw + and / before parsing and back after. /api/open
lets that link through. aionui's database status is generalized into
dbStatus{has} so both apps share it. Icon: Cherry Studio's own logo, not
cherryin-color (a different product).
Run (mote, at this change on origin/main c66cdbea9; then rebased on
|
||
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
628ac36fc9 |
agents: Add magpie says when nothing here opens the app's import link (sungt)
sungt (Discord #feedback, Windows, magpie 0.1.1976, Cindy 0.1.119, Cindy
open): on the Agents page Cindy's 添加 magpie "spins, no response".
What magpie got wrong: Cindy, AionUi and Lody take magpie only through
their import link, which magpie hands to rundll32 / open / xdg-open and
never waits on. A link nothing opens did nothing, the button never awaited
/api/open nor caught its error, and `magpie cindy add` printed "opened"
whatever happened.
- agent.OpenAppLink asks the system, without opening anything, whether
something opens the link's scheme: Windows' HKCR\<scheme> (what
Electron's setAsDefaultProtocolClient writes) and then the user's
UrlAssociations UserChoice; macOS Launch Services (cgo builds); Linux
`xdg-mime query default`. Only "none", or a registered program whose
full path is gone, refuses the link (NoLinkHandlerError); anything
unknown hands it over as before.
- /api/open (Cindy, AionUi, Lody after OpenLody) answers
code no_link_handler with app, exe and said, an i18n.js key from
linkSaid that api() puts through t() as it does bunSaid's.
- The import button now waits for /api/open and shows the result: "Sent
to {name}: confirm adding magpie there", or the reason in the
reader's language.
- The CLI's add returns the same error.
This is not verified as sungt's cause. Cindy was open, and Cindy
registers cindy:// at every start, so the check most likely passes on
their machine. If so, the spinner is Cindy's own import dialog
(previewProviderImport / fetching magpie's /v1/models). Cindy 0.1.119
wasn't available here. We still need Cindy's log around "received deep
link" from sungt.
Run (worktree at origin/main
|
||
|
|
4b1994ad31 |
agent: AionUi, added through its add-provider link
seven7032 on Discord asked how to connect AionUi to magpie. AionUi
keeps its providers in its own SQLite database
(<userData>/aionui/aionui-backend.db, WAL mode), each key encrypted, so
there is no config file for magpie to write. The one supported way in
is its deeplink. AionUi 2.2.2's main process parses it
(parseDeepLinkUrl), and its renderer opens Settings -> Model with the
add form filled in, which the user confirms:
aionui://add-provider?api_key=magpie-aionui&base_url=<gw>/v1&name=magpie&platform=custom
The AionUi row works the way Cindy's and Lody's do:
- Add magpie opens that link. /api/open allows the aionui://add-provider?
prefix only. `magpie aionui add` opens it from the CLI.
- The key is agentKeyAt("aionui"), so it becomes the LAN key while
sharing is on (added to TestPinnedGatewayKeyForEveryWriter).
- "custom" is AionUi's OpenAI-compatible platform. Its base URLs end in
/v1, as its own OpenAI preset's does.
- Added reads providers.base_url for the gateway's address without
touching the database (sessions.OpenUntouched, from the previous
commit). A database that can't be read is unknown, never "not added".
The last read is kept while the database and its log keep their size
and time, for 15s at most, so the Agents poll doesn't copy a running
AionUi's database every time.
- It is detected by userData/aionui (os.UserConfigDir()/AionUi on every
OS).
- As with Cindy and Lody, the TUI leaves the row out (nothing to pick).
Tests:
- TestAionUiLink: the link's exact bytes.
- TestAionUiLinkParsedAs2_2_2: runs the link through
testdata/aionui/deeplink-2.2.2.js, which is parseDeepLinkUrl copied
byte for byte from 2.2.2's app.asar (out/main/index.js 50995-51021)
plus the renderer's add-provider mapping and the form prefill. The
result is action add-provider, route /settings/model, and the form gets
platform custom, the /v1 base URL and the key.
- TestAionUiHas: a fixture database built from 2.2.2's real providers
schema (taken from the database 2.2.2 made at first start). It covers
none, another gateway, a row present only in the log of a running app,
and a closed app, and checks that AionUi's folder is unchanged each
time.
- TestAionUiUnreadableIsUnknown, TestAionUiStatusRereadsOnChange,
TestAionUiDetect, TestAionUiImportRow (GUI: the row, unknown status,
and /api/open refusing other aionui:// links).
- import-row.test.cjs gains the AionUi row (icon, known status in each
language, the click opens the exact link, and it fits at 420px), in
chromium and webkit across en, zh, zh-TW, ja and de. The same file
now waits for the rows to settle before its alignment check: under
load 105 one run caught Cindy's button mid-resize at 193.4px beside
the picker's 194.4px. The old file passed 3/3 alone, so it is a
timing assumption, not a layout bug.
Run at 18041fc5b (this change on origin/main
|
||
|
|
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
|
||
|
|
c6bd4e9707 |
agent: let Lody confirm local provider imports
Offer Lody a versioned import link for Claude, Codex, Pi, DSH,
Kimi Code, Grok and Bub. Export only loopback endpoints and the public
magpie-lody token. Leave Lody data untouched and show a confirmation hint
when the app exposes no public import-status reader.
Verified: go test -tags nogui ./... in a temporary HOME with pinned Go
caches; native, Linux nogui and Windows vet/build; gofmt and diff checks;
17 Chromium/WebKit import-row and locale checks. The actual Lody parser
accepted all seven targets with IPv4, localhost, IPv6 and canonical ports.
Negative controls: removing registration fails
TestLodyDetectionAndRegistration with "Lody missing from Agents";
removing URL handoff fails TestLodyImportHandoff with
"Lody import was not handed to the desktop". Restored tests pass.
Desktop launch and Linux/Windows runtime behavior were not exercised.
Cherry-picked onto main (
|
||
|
|
e05e3886f9 | gui: Cindy's row on the Agents page is laid out as the others (owner: Cindy 这个排版好奇怪啊,跟别的格格不入啊) — an app magpie is added to by a link of its own had no 「接入」 kind, so its row was drawn the old way: no line under the name, and its Add magpie button spanning both picker columns, wider than every other row's model picker and out of line with it. It is now kind "link": a line under the name says Not added · Cindy asks to add magpie when its link opens, or Added · magpie is a provider in Cindy (green dot), and its button stands where the others' model picker does, 196px and lined up with it, the switch's room kept beside it empty. zh, ja, de strings. import-row.test.cjs (Chromium and WebKit, en and zh, added or not): the line, the button lined up with Crush's picker at 960 and 700px, a click opens the link; it fails on the old code (no line). agent-layout, agent-start-pick, agent-disconnect, agy-launch, desktop-model-menu, gui-ja, gui-de and click-scroll pass on WebKit; go vet and go test -tags nogui ./internal/gui/ pass. |