anganing (Windows 11, v0.1.1229): after an auto-update, every switched-on
plugin said "no such plugin: …\node_modules\@magpie-community\opencode-grok-auth"
at each start. For the github: plugins the path was the spec itself
(node_modules\github:owner\repo), so package.json no longer listed them.
Removing a plugin and adding it again was the only way out.
- InstallMissing installs again each listed plugin (switched off or not)
whose package isn't in plugins/, from its own spec. KeepUpdated runs
it 30s after start and then hourly, before CheckUpdates. Nothing did
this before: CheckUpdates skips a plugin with no installed version.
- installMu serialises every bun command that changes plugins/: install
(including the first package.json it writes), reinstall's bun update,
and Remove's and add's bun remove. At start KeepUpdated (30s) and
keepMovedCurrent (20s) each run bun add with no lock. On the Windows
box, three concurrent bun add runs (Bun 1.4.3) in one folder kept only
one writer's package.json change. A git plugin's dependency dropped
that way leaves Name() unresolved, which is the reporter's github rows.
The exact sequence that emptied the reporter's node_modules wasn't
reproduced. Bun 1.4.2 -> 1.4.3, magpie v0.1.1205 -> v0.1.1227 with the
same plugins, and a package.json reset all left the folders in place.
So this repairs the state and closes the one race found. It isn't
proven to be the trigger.
Run:
- go test ./internal/plugin ./internal/provider -count=1: ok.
- The new tests -count=3 on macOS, and on the Windows box as a
cross-built test binary: ok.
- Broke each fix by hand (lock a no-op; InstallMissing returns early):
TestBunCommandsOneAtATime fails with "another bun is running here",
and TestMissingPluginsInstalledAgain gets 0, want 2.
- Real use on the Windows box, sandbox HOME, port 3561, real Bun 1.4.3:
deleted opencode-grok-auth and opencode-qoder-auth from node_modules
and started serve built from this commit. The host logged the
reporter's exact "no such plugin" for both. At +30s it logged
"installed 1 missing plugins again" and both folders were back.
After the restart, no plugin failed to load.
- gofmt -l internal/: clean. go vet for darwin, linux -tags nogui and
windows (plugin, provider, gateway), and GOOS=windows go build ./...:
ok.