yetone
667ac8bd6f
settings: a look at one setting takes the shared settings, not a copy
...
settings.Load() copies the whole Settings (clone + deepCopy of every map
and slice) for each caller. 133 places read one field of it and threw
the rest away: the proxy for every outgoing request (netproxy), the
GitHub token, the China mirror switch, a model's output cap, wire or
price on a gateway request. With a real account in the tray, Load's
clone was 26.6 MB of the 318 MB the process allocated in its first
seven minutes, most of it through netproxy.For on each request.
Each of them now reads settings.Shared(), the read-only settings every
caller is given for the same settings.json. Only reads were changed:
a scalar field (string, bool, int, float) or a map field's index
read. A caller that keeps a whole map or slice, or calls a method on
the settings, still takes Load's copy.
2026-11-14 14:02:49 +08:00
..
2026-11-14 02:14:31 +08:00
2026-10-18 07:13:09 +08:00
2026-11-13 08:52:12 +08:00
2026-10-16 20:05:11 +08:00
2026-10-19 09:40:45 +08:00
2026-11-10 12:54:39 +08:00
2026-10-25 05:54:07 +08:00
2026-10-14 20:56:18 +08:00
2026-10-09 01:02:51 +08:00
2026-11-07 06:09:42 +08:00
2026-11-10 12:54:39 +08:00
2026-11-03 17:24:19 +08:00
2026-11-11 15:07:54 +08:00
2026-11-11 15:07:54 +08:00
2026-10-19 09:40:46 +08:00
2026-10-31 22:22:12 +08:00
2026-11-01 12:12:05 +08:00
2026-10-31 22:22:12 +08:00
2026-11-10 12:54:39 +08:00
2026-11-10 11:44:17 +08:00
2026-11-10 22:37:28 +08:00
2026-11-10 01:44:24 +08:00
2026-10-31 17:00:14 +08:00
2026-11-11 11:50:13 +08:00
2026-11-05 03:54:41 +08:00
2026-10-30 15:53:22 +08:00
2026-10-31 17:00:14 +08:00
2026-10-28 03:50:46 +08:00
2026-11-11 15:07:54 +08:00
2026-10-11 01:14:19 +08:00
2026-11-10 12:54:39 +08:00
2026-10-29 00:01:12 +08:00
2026-10-19 09:40:45 +08:00
2026-11-08 21:43:52 +08:00
2026-11-05 16:58:34 +08:00
2026-10-11 00:20:25 +08:00
2026-11-03 07:43:18 +08:00
2026-11-06 00:34:42 +08:00
2026-11-06 00:34:42 +08:00
2026-11-06 00:34:42 +08:00
2026-11-11 12:26:43 +08:00
2026-11-14 02:14:31 +08:00
2026-11-13 13:32:32 +08:00
2026-10-23 16:57:33 +08:00
2026-10-20 20:23:51 +08:00
2026-10-20 20:23:51 +08:00
2026-10-15 03:34:58 +08:00
2026-10-15 23:08:04 +08:00
2026-11-01 14:28:25 +08:00
2026-11-03 05:21:47 +08:00
2026-10-13 13:02:58 +08:00
2026-11-01 05:51:13 +08:00
plugin, gui, docs: Plugins says which plugins are providers and which are middleware, lists the community's ready-made middleware, and edits a middleware's options in its row (the owner) — the Plugins page still read as if every plugin were a subscription, and nothing showed what a middleware does or let you set its options without editing plugins.json. Every Discover card and Installed row now carries a Provider or Middleware chip (both for a plugin that is both), also for one that is off (isMiddleware/middlewareOnly from the server, read from its files); Discover splits into Subscriptions and Gateway middleware ("runs in magpie's gateway on what every agent sends and gets back, whichever provider serves it"), the latter from market entries with "kind": "middleware" and no providers or icon (the built-in market.json lists the five new @magpie-community/middleware-* packages: param-override, model-map, system-prompt, word-guard, think-tags, mostly New API's channel settings with the same JSON). A middleware row has Options: a JSON editor in the row, starting from the package's magpie.options example when none are set, which validates it is an object, saves (POST /api/plugins/options) for the next request, clears, and cancels with Esc. magpie plugin options takes a short name (model-map for @magpie-community/middleware-model-map; plugin.ShortName, also in SetOptions). en/zh/ja/de. Docs: usemagpie.ai/docs/plugins (en/zh/ja) gains Ready-made middleware and Options and the registry's kind; reference.md, both READMEs and docs/subsystems/gateway-middleware.md likewise. Tested with a real DeepSeek account and real Claude Code through magpie web --gateway in a sandbox HOME, with all five installed and options set by short name: a mapped model named back, max_tokens capped, a prompt appended for claude only, word-guard's 400 and param-override's 403 in the agent's shape, <think> stripped from Chat and Responses streams and a whole Anthropic reply, reasoning_content moved into the text; /api/plugins showed the kinds and the example. TestSetOptionsShortName is new; TestBuiltinMarket checks a middleware entry has no providers or icon and no other kind. plugin-middleware.test.cjs (Chromium and WebKit, en and zh: the chips, Discover's two sections, the options editor with its errors, no select, no scroll, no left border) fails without the change; the other plugin tests and click-scroll pass in WebKit (plugin-market's section name updated; plugin-move fails only under parallel load and passes alone). go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-05 20:50:09 +08:00
2026-10-27 18:43:32 +08:00
2026-11-02 14:12:20 +08:00
2026-11-11 16:24:37 +08:00
2026-11-02 14:49:36 +08:00
2026-10-15 22:36:59 +08:00
2026-11-10 09:38:45 +08:00
2026-10-14 23:52:15 +08:00
2026-10-08 23:09:25 +08:00
2026-10-31 18:30:39 +08:00
2026-11-04 22:47:11 +08:00
2026-10-26 15:02:10 +08:00
2026-10-30 21:46:47 +08:00
2026-10-31 22:39:37 +08:00
2026-11-10 12:54:39 +08:00
2026-10-31 17:03:55 +08:00
2026-11-04 01:53:46 +08:00
2026-11-10 19:53:54 +08:00
2026-11-06 11:51:38 +08:00
2026-11-09 19:16:48 +08:00
2026-10-10 00:55:38 +08:00
2026-10-10 18:11:00 +08:00
2026-10-28 22:20:56 +08:00
2026-10-31 02:00:10 +08:00
2026-10-31 02:00:10 +08:00
plugin host: a plugin's node:http2 connection goes through magpie's proxy like its fetch does ( #1035 , cataglyphis: Cursor opus-5-5 high ends after ~148s with "Cursor: 502 Bad Gateway" cursor_error) — the Cursor plugin runs agent.v1.AgentService/Run over node:http2, which Bun connects directly and ignores the proxy that host.js gives every fetch; the built-in sent the same request through s.client, so a user who needs magpie's proxy (setting, env or the system's) to reach Cursor had their sign-in, models and usage proxied but every Run went out directly. host.js now wraps http2.connect: for a URL proxyFor gives a proxy to (provider/account via, global, SOCKS bridged), it opens an HTTP CONNECT tunnel (Proxy-Authorization from the URL) and runs TLS with ALPN h2 over it; "direct", a caller's own createConnection and unproxied URLs keep Bun's connect; a tunnel that fails ends the session with "proxyconnect tcp: …". TestPluginHTTP2TakesTheProxy (an HTTP/2 vendor at an unresolvable host reached only through a CONNECT proxy; direct and a dead proxy fail with the reason) fails without the change ("h2: getaddrinfo ENOTFOUND h2vendor.invalid"; it carried 0) and passes -race -count=10. With the owner's Cursor account in a sandbox HOME and a logging proxy set, Claude Code's captured request on cursor/claude-opus-5-5 high: before, the proxy saw api2.cursor.sh only; after, it also sees agentn.global.api5.cursor.sh and the reply streams. The reporter's 502 wasn't reproduced here (direct runs answer in 4–20s). go test -race ./internal/plugin, the gateway/provider Plugin|Proxy|Cursor tests, gofmt and vet pass.
2026-10-06 22:16:24 +08:00
2026-11-09 18:29:55 +08:00
2026-11-03 21:01:27 +08:00
2026-10-11 14:07:21 +08:00
2026-11-09 18:29:55 +08:00
2026-11-03 07:43:18 +08:00
2026-10-14 09:17:47 +08:00
2026-10-13 09:47:51 +08:00
2026-11-02 14:30:45 +08:00
2026-11-05 00:55:36 +08:00
2026-11-10 12:22:53 +08:00
2026-11-04 16:25:02 +08:00
2026-11-06 20:16:44 +08:00
2026-10-23 16:57:33 +08:00
2026-11-10 09:35:32 +08:00
2026-11-06 05:53:23 +08:00
2026-11-12 11:14:56 +08:00
2026-10-26 15:09:09 +08:00
2026-10-23 16:57:33 +08:00
2026-10-31 01:11:31 +08:00
2026-10-13 14:29:52 +08:00
2026-10-31 02:00:10 +08:00
2026-10-16 05:29:20 +08:00
2026-11-14 02:14:31 +08:00
2026-11-11 04:28:18 +08:00
2026-11-11 04:28:18 +08:00
2026-11-11 16:24:37 +08:00
2026-11-11 16:24:37 +08:00
2026-11-11 11:50:13 +08:00
2026-11-11 11:50:13 +08:00
2026-11-03 17:58:31 +08:00
2026-10-31 04:24:59 +08:00
2026-11-14 14:02:49 +08:00
2026-11-10 09:35:32 +08:00
2026-10-25 11:52:02 +08:00
2026-11-02 14:12:20 +08:00
2026-11-06 13:17:22 +08:00
2026-11-11 12:26:43 +08:00
2026-11-04 20:55:42 +08:00
2026-11-10 12:54:39 +08:00
2026-10-13 15:48:53 +08:00
2026-11-04 13:23:28 +08:00
2026-10-09 19:35:35 +08:00
2026-10-12 23:33:56 +08:00
2026-10-12 23:33:56 +08:00
2026-10-16 03:41:22 +08:00
2026-10-10 22:54:09 +08:00
2026-11-10 12:54:39 +08:00
2026-10-28 13:50:41 +08:00
2026-11-05 16:58:34 +08:00
2026-10-28 13:50:41 +08:00
2026-11-05 16:58:34 +08:00
2026-10-15 22:36:59 +08:00
2026-10-30 22:33:25 +08:00
2026-10-25 11:52:02 +08:00
plugin: magpie plugin update in a terminal restarts the app's plugin host ( #952 , mxzs123) — the running magpie noticed another magpie's plugin change only by plugins.json, which an update leaves as it was (the spec stays, bun installs a newer version), so the app's host went on answering with the old code (0.1.17 after the update to 0.1.18, still 403) until it was killed. The stamp checkList compares now also covers what is installed: Dir()'s package.json and bun's lockfile; and Restart takes the stamp as it is, so this magpie's own install isn't taken for another's and restarted twice. In a sandbox (serve on 3476 under its own HOME, the Factory plugin at 0.1.17, unpinned spec; a request, then magpie plugin update in another process, then a request): on 2d85a086 the host process stayed the same (58657) with 0.1.18 installed; with this change it was replaced (60004 → 60583) and the old one stopped. TestTerminalUpdateRestartsTheHost is new and fails without the change; go vet and go test -race -tags nogui ./internal/plugin/ ./internal/provider/ under a temp HOME pass.
2026-10-06 08:47:59 +08:00
2026-10-09 12:57:56 +08:00
2026-10-15 09:36:26 +08:00
2026-11-02 03:54:00 +08:00
2026-10-23 16:57:33 +08:00
2026-11-02 03:54:00 +08:00
2026-11-01 22:14:19 +08:00
2026-10-10 22:54:09 +08:00