Commit Graph
5 Commits
Author SHA1 Message Date
yetone b52c711142 Restore what 85e6ec540 reverted: it was committed on a stale index and took out b587eb306's and earlier work (webview2, library skills, opencode endpoints, quotas); this puts the tree at b587eb306 plus the Paseo agent only 2026-11-11 23:09:15 +08:00
yetone 85e6ec5406 agent: Paseo's Claude model picker lists magpie's models (@TheMist016 on X)
Paseo (getpaseo/paseo) starts the same Claude Code, but builds its own model
list: first-party models plus settings.json's `model` and a few
ANTHROPIC_*_MODEL variables (providers/claude/models.ts). It never reads
Claude Code's modelPicker, where magpie writes every model, so the rest were
not selectable in Paseo. Paseo's own ~/.paseo/config.json takes
agents.providers.claude.additionalModels ([{id,label,description}], checked
against protocol/src/provider-config.ts) and passes each id to Claude Code as
written.

New agent "Paseo" (detected by ~/.paseo or PASEO_HOME): its switch writes the
models Claude Code's /model lists (same ids, [1m] marks, names; only the ones
picked for it) there, marked "via magpie" in the description; the user's own
entries and keys stay, off takes out only magpie's, a sync refreshes when on.
Claude Code must be connected to magpie as well.

Run (mote-run, sandbox HOME in tests): TestPaseoAdditionalModels,
TestStateListsPaseo, internal/agentenv, internal/gui full package ok;
internal/agent full run red only on TestPiGroupEntryKeepsItsMembers, which is
red the same on origin/main 12cd456f2 (passes alone; filed). gofmt clean,
vet darwin, windows and linux nogui on internal/agent. Broken by hand: Set
writing no models goes red.
Not tried: a real Paseo daemon reading the file (checked against its schema
source only); GUI browser suites.
2026-11-11 23:08:39 +08:00
yetone fb6b4de0a9 gui: a WebView2 that doesn't come up waits for the old profile lock, then starts again (@ljlwlcz on X)
0.1.3688 on Windows 11: after a restart by a script, "timed out after 1m0s
waiting for the WebView2 controller" and the window never came back. Wails
waits 60s in Embed for a controller, then exits the process (ErrorHandler
runs, then os.Exit). The cause is a start that meets the previous magpie's
msedgewebview2 still holding the profile folder (EBWebView\lockfile, opened
without sharing).

- Before the first window, the start waits (30s at most) until the profile
  folder's lockfile can be opened, i.e. the old WebView2 has let go. The
  folder is the one passed to Wails, else Wails' %AppData%\<exe name>.
- ErrorHandler now logs the error with the WebView2 runtime version, the
  folder and whether another process holds it.
- On a WebView2 failure the process starts itself again (update.Respawn,
  MAGPIE_REPLACES set so the new one waits for this one to exit), backing
  off 2s, 4s; after 3 starts a box says what failed and what to do.

Run: gofmt; go vet darwin, GOOS=windows, GOOS=linux with and without
nogui; go test of the WebView2 tests on mote; the same on xiaomi-gpu via
win-run, where TestWebView2FreeSeesTheHeldLockfile holds a real
non-shared file and goes red when webView2Free is forced true (broken by
hand). Full gui/update/proc packages on mote.
Not tried: a real WebView2 timeout and the restart (the controller
timeout can't be forced here without the live app); Wails still exits
the process after the handler, so the tray does not stay up through a
failed start, it is started again instead.
2026-11-11 22:58:27 +08:00
yetone a51b90ce30 gui: the WebView2 notice also gives winget's command for the runtime (#1806)
ufec confirmed the notice works and asked that it say the runtime can be
installed with winget too. Each language's box now adds
"winget install Microsoft.EdgeWebView2Runtime" under Microsoft's page
(the id is winget-pkgs' manifests/m/Microsoft/EdgeWebView2Runtime).

Ran: go test ./internal/gui -run WebView2 (TestWebView2Notice now checks
the command in every language; red without the strings), gofmt -l,
GOOS=windows go vet ./internal/gui.

Reported-by: ufec
2026-10-13 09:50:04 +08:00
yetone ff49ca72fe gui: Windows without the WebView2 runtime says so in a message box and offers the download page, instead of a double-click doing nothing (#1806)
magpie's windows are WebView2, which Windows 10 doesn't always have.
Without it Wails handed the failure to ErrorHandler and exited, and the
desktop build (-H windowsgui) has no console for the log line to land
in: ufec's double-click came up to nothing at all. ufec found the cause,
that Wails' own Env.Info().PlatformInfo["WebView2"] answers "" then, and
that a box can't come from ErrorHandler (it runs on the thread Wails
makes its windows on); this takes both from their branch.

Run asks webView2Check right after application.New, before any window.
Missing, it logs it and shows MessageBoxW (Yes/No, error icon, topmost)
in the reader's language (trayLang): the runtime is missing, Microsoft's
page https://developer.microsoft.com/microsoft-edge/webview2/, that
"magpie web" and "magpie tui" work without it, and whether to open the
page now; Yes opens it (ShellExecute), and Run ends. A key Wails doesn't
set is read as present: refusing to start a magpie that would have
worked is worse than the silent exit. The tray isn't kept: its panel is
a WebView2 window too.

Run: TestWebView2Missing and TestWebView2Notice (all OSes);
TestWebView2MissingFromWails on the Windows box (10.0.0.132, Windows
with WebView2 installed): a child process with Wails pointed at a folder
that isn't a runtime reads missing, the machine's own runtime reads
present. TestWebView2Missing goes red with webView2Missing made to answer
false. On the box, a throwaway -H windowsgui test binary calling
webView2Check with that bogus runtime path, run in the desktop session:
the box came up titled "magpie 需要 WebView2" with the Chinese text, the
page and 是/否 buttons (read back from the dialog's controls), the log
line was written, pressing 是 opened the page in Edge and the check
answered false. go test -tags nogui ./internal/gui in a sandbox HOME;
gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui and
GOOS=windows; windows and linux builds.

Not tried: a machine that really lacks the runtime (the box has it; the
missing case is Wails' lookup failing on a path that isn't a runtime,
the same failure), nor a real magpie.exe start through Run.
2026-10-12 22:03:29 +08:00