yetone
47b51c8225
plugin: an OAuth sign-in with no refresh token is kept, and one with nothing to keep fails (plugins#998)
...
host.js keeps an OAuth sign-in only when "refresh" is in the plugin's
result, as OpenCode's CLI does. codearts' "Sign in from CodeArts Agent"
returned an access with no refresh field, so the callback said ok and
nothing was stored: the CLI printed "signed in" and no account showed.
callback now keeps an access with no refresh as an OAuth sign-in with an
empty refresh, and a success with nothing to keep (no refresh, key or
access) fails with "<provider>'s sign-in gave nothing to keep", as
apiKey's "gave no key" already did. The plugin side is fixed too
(codearts 0.3.14, plugins 4e3a7868); this covers any other plugin that
leaves the field out.
TestSignInWithNoRefreshIsKept drives both through the signinend fixture
(methods 8 and 9) and checks the kept record is oauth with refresh "".
Ran on mica: go test -count=1 ./internal/plugin/ ./internal/provider/ ok;
GOOS=windows and GOOS=linux go vet ./internal/plugin/ ok; gofmt -l clean.
Broken by hand: with host.js at its parent, the new test fails on both
cases (nil error, nothing kept).
Not tried: the full suite at this head (one is running on mica for
805e5c29a ), a real CodeArts Agent sign-in.
Reported-by: AyakaChen1 <AyakaChen1@users.noreply.github.com >
2026-11-12 11:14:56 +08:00
..
2026-11-12 11:14:56 +08:00
2026-10-18 07:13:09 +08:00
2026-11-04 01:53:46 +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-12 11:14:56 +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
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-10 20:16:44 +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-10 12:54:39 +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