65cb76ca2e2b59892ecb41fd3fcf6dbe07dde1c3
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4197144a8 |
perf: every package's package-level regexps compile on first use
v0.1.3516 made gateway's and redact's patterns lazy. The other 299 package-level regexp.MustCompile calls, in 148 files across agent, provider, gui, library, codexcat, sessions, usage, plugin and the rest, now go through lazyre.New too, so a launch that never reaches them (`magpie statusline`, run by Claude Code on every message) doesn't compile them. Fields, maps and params that held them are *lazyre.RE. Measured on mote (M5 Pro), sandbox HOME, v0.1.3516-equivalent build (t42) against this one (t43): - GODEBUG=inittrace=1 sum: 7.39 MB / 69,837 allocs -> 4.62 MB / 46,765 - `magpie statusline`, 3 runs each: instructions retired ~212M -> ~176M, peak memory footprint 19.2-19.4 MB -> 16.8-17.0 MB Run: go vet ./... (darwin) ok; GOOS=windows go vet on each of the 30 changed packages ok; GOOS=linux go vet ok except ., internal/cli and internal/gui, which stop in wails v3's cgo files when cross-compiled (the same at main). New TestAllLazyPatternsCompile at the root compiles all 574 registered patterns (ok), so a bad pattern fails a test rather than a first use. Not run before push: the changed packages' own test suites; they run on mote after it. |
||
|
|
4bfac12683 |
plugins: downloads take a proxy of their own, apart from the vendors' (JonahFu on X)
JonahFu on X: GitHub is unreachable without a proxy, while API requests may go direct, so plugin downloads' proxy should be set apart from the one model requests take. Before: plugin downloads already followed the global proxy (fetches through http.DefaultClient and netproxy.Func, bun add and git through netproxy.Env), so nothing ignored it; there was only no way to give them a different one. Now Settings › Network has a Plugin downloads row under Proxy: Same as above (the default, unset: downloads follow the global proxy as before), Direct, or Custom with its login, remembered as pluginProxyCustom as Proxy's Custom is. The CLI takes it as `magpie settings set pluginProxy <url|direct|"">`. It covers the plugins list and Discover's lists (fetchJSONFrom), a user's own npm registry (fetchRegistry), Bun's download (getURLFrom), bun add/update/remove and the git commands of GitHub-installed plugins (dlEnv). The plugin host (bun run) keeps the global proxy: its requests are the vendors'. Both fields belong to this computer (KeepOwn) and are left out of auto-backups, since a proxy URL may hold a password. Settings' Proxy row and the new one are drawn by one helper (proxyRow); the core's script budget is met by cutting the proxy rows' comments, no raise. Run (mote, through mote-run): gofmt -l clean; go vet of the touched packages (darwin), GOOS=linux -tags nogui ./..., GOOS=windows of the touched packages; go test -count=1 internal/settings, settingsapi, backup, netproxy, plugin, gui, cli all ok (gui after the comment cut; its first run had TestCoreScriptBudget 1,352 bytes over). GUI, chromium and webkit: settings-plugin-proxy (new, 5 languages x 2 widths), settings-proxy-remember, settings-proxy-auth, proxy-test, settings-sections, proxy-login-fields and the i18n files: 102 pass, 0 fail. plugin-proxy-page, proxy-own-wording, account-proxy, provider-proxy, routing-proxy, provider-many-keys-proxy and signin-proxy: 104 pass, 2 fail, both signin-proxy's "a subscription with no proxy offers the global one" at 380px in Chromium, red the same way on origin/main |
||
|
|
a5ccf3f23f |
plugins: an update of an unfixed git source re-resolves the branch, not the lock's old commit (#2954)
What changed - Before Bun resolves a git plugin's spec, the branches and tags of its repository are fetched into the bare clone Bun keeps in its install cache (refreshGitCache in gitrev.go): best-effort before install's bun add (a remote that can't be reached leaves the install to what the cache has), an error before reinstall's bun update (an update that didn't happen is not reported as done). - When bun update exits 0 but the plugin is still behind the commit the update checks saw the repository at, reinstall says so instead of claiming the update. - A spec that names a commit (#<sha>) is left alone: nothing is resolved for one, and its pin stands. - docs/subsystems/provider-plugins.md: this git update path. Why A plugin added from an unfixed git+https://... URL could not be updated (#2954): plugins/package.json named no commit, but Bun resolves a git spec through its own bare clone of the repository in the install cache, whose refs stay at the first install - a fetch there moves FETCH_HEAD, not the clone's refs/heads. Every resolve after the first, bun update as much as a bun add after a remove, therefore named the old commit again, bun.lock re-recorded it (name@git+...#bb961b2...), and the update said it had installed while node_modules kept 0.1.3. The lock is the record of that resolution, not its cause. Verified with Bun 1.4.2 (the version magpie runs) against a local git+file:// repository: after the branch moved, bun update my-plugin answered "no changes" and exited 0, and so did bun install with the lock entry dropped, bun update --force and bun install --force; with the clone's refs fetched, the same bun update installed the branch's commit now. Run go test ./internal/plugin/ -count=1 (ok; new: TestGitUpdateInstallsTheBran chsCommitNow and TestGitUpdateKeepsACommitPin on the bun on PATH against a local git+file:// repository, TestGitUpdateSaysWhenItDidnt with the fake bun keeping the lock's commit, TestRefFixed, TestSameRepoAndCloneOrigin) go test ./internal/cli/ ./internal/provider/ -count=1 (ok) gofmt -l (clean); go vet ./internal/plugin/ on darwin, linux and windows (ok); builds of darwin and of windows (CGO_ENABLED=0 -tags production, as the Makefile cross-compiles it) and of the 79 Linux packages that don't need Linux GTK cgo (the GUI and cli are built natively per machine, as the Makefile says). Review (magpie): patch sha256 checked against the issue; read whole. Run at the batch head on the Mac mini: go test ./internal/plugin -count=1 ok, the real-Bun git e2e among them (not skipped); on the Windows box TestGitUpdate* pass. Broken by hand: store.go at the base - TestGitUpdateInstallsTheBranchsCommitNow ("still at 1.0.0, want 2.0.0") and TestGitUpdateSaysWhenItDidnt red; only install()'s refresh removed - "installed again: 2.0.0, want 3.0.0". Not tried: a real plugin from a real GitHub branch. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
7af45761f7 |
plugin, gui: a plugin from a git repository shows Update only when its repository has new commits (ARNO on Discord)
ARNO installed opencode-codearts-auth as github:yuweihao17/codearts. Its row
on Plugins always had an Update button, and still did right after updating
it to the newest commit. The page drew Update for every git plugin whatever
its commit, since npm has no version to compare for one, and nothing asked
the repository.
|