ac4af582301a4e8a29245dbba767eba31334ddf9
10
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4e85cac01d |
agent: OpenCode installs as OpenCode 2 (@opencode/cli, opencode.ai/v2/install) (math_milian)
math_milian on Discord: magpie's npm command for OpenCode installs
OpenCode 1, and OpenCode 2 isn't installed that way. On 2026-11-05
opencode-ai's latest is 1.19.5 and it has no 2.x; OpenCode 2 is
@opencode/cli (2.2.5, anomalyco/opencode's README), and
opencode.ai/install refuses a 2.x ("not an OpenCode 1 release") and
points to opencode.ai/v2/install.
- Install: opencode.ai/v2/install on a Mac or Linux, then
npm install -g --allow-scripts=@opencode/cli @opencode/cli. Air's
"OpenCode isn't installed" notice says the same, in every language.
- Update: an install from either package is updated within it (npm,
bun, pnpm by where it sits; brew's opencode or anomalyco/tap's
opencode-v2). An installer copy in ~/.opencode/bin is offered its
own line's newest: OpenCode 2 @opencode/cli's, OpenCode 1
opencode-ai's, since OpenCode 1's opencode upgrade runs the v1-only
installer. An unreadable version promises none.
- An existing opencode-ai install isn't moved to OpenCode 2: its
config differs, and npm needs --force over the other package's bin.
Run (mote): gofmt -l, go vet ./internal/agent, GOOS=linux/windows go
vet, go test ./internal/agent -run 'Install|UpdateCLI|HowInstalled|Mend|
Npm|Bun|Pnpm|Shim|Scripts|CLI|OpenCode|Air' ok; node --test i18n-keys,
i18n-en-no-cjk, agent-air-own, agent-notice-lang, agent-cli-missing: 82
pass. Real, sandbox HOME on mote: curl -fsSL opencode.ai/v2/install |
bash gave ~/.opencode/bin/opencode and opencode2, "opencode v2.2.5";
`opencode upgrade 2.2.4` from there went to v2.2.4 (magpie's target
form); npm 10.9.4 and 11.21.2 with magpie's exact command gave v2.2.5,
opencode2 too; `opencode acp` is in 2.2.5 for Air.
Broken by hand: opencode-ai first in npm turns TestInstallCommands red;
without the line hook TestUpdateCLIOpenCodeKeepsItsLine/1.19.4 is
offered 2.2.5 and TestUpdateCLIOpenCodeTakesVersion goes red.
Not tried: Windows npm install for real, Homebrew's opencode-v2 tap,
moving a real opencode-ai user to OpenCode 2.
|
||
|
|
06808ad308 |
agent: an agent's npm package that needs its install script gets it run on npm 12, bun and pnpm
npm 12 runs a package's install script only when told to (--allow-scripts=<pkg>), and bun (--trust) and pnpm 10 (--allow-build) do the same. A package whose postinstall puts its binary in place then installs a stub: @opencode/cli 2.2.5 from npm 12.2.2 or bun 1.4.2 without the flag prints "@opencode/cli's postinstall script was not run" and exits 1 (mote, sandbox HOME). OpenCode's own v2 updater passes the same flags. cliSpec.scripts marks the agents whose npm package has an install script: `npm view <pkg> scripts` on 2026-11-05 named one for claude, cline, crush, deveco, mothx, omo, opencode and snow, and none for the rest. Their install command, their npm/bun/pnpm update and the mend hint now carry the manager's flag. npm 10 and 11 run scripts anyway and take --allow-scripts as an unknown config. Run (mote): gofmt -l, go vet ./internal/agent, go test ./internal/agent -run 'Install|UpdateCLI|HowInstalled|Mend|Npm|Bun|Pnpm|Shim|Scripts|CLI| OpenCode|Air' ok, and GOOS=linux/windows go vet ok. Real: on mote, npm 10.9.4, 11.21.2 and 12.2.2 with --allow-scripts=@opencode/cli each gave a working opencode v2.2.5; npm 12 without it and bun without --trust the stub; bun with --trust a working one. Broken by hand: withScripts never adding the flag turns TestInstallLetsScriptsRun, TestUpdateLetsScriptsRun and TestUpdateCLIChecksItRuns red. Not tried: pnpm and yarn for real (mote has neither), the other seven agents' packages on npm 12. |
||
|
|
486ea82378 |
agents: cursor-agent's row is Cursor CLI (@G_Z_Y on X)
@G_Z_Y looked for Cursor CLI on the Agents page and took the "Cursor" row
for the editor. The row is cursor-agent, so it is named Cursor CLI. What
it keeps in ~/.cursor is the Cursor editor's too (MCP servers, skills,
chats), so the Library and Sessions name it Cursor there (SharedName).
Run at this head before the rebase onto
|
||
|
|
e528aeb3ce |
agent: DevEco Code, Huawei's OpenCode, as an agent (#1885)
foobra asked for DevEco Code (npm @deveco/deveco-code), Huawei's
HarmonyOS coding agent. It is OpenCode underneath, so it joins through
openCodeLike as MiMo Code did (
|
||
|
|
e2b3eb7406 |
agent: an npm -g agent under mise's Node says its version and updates with that Node's npm, not "can't tell how it was installed" (flp on Discord)
On Windows with Node managed by mise, the Agents page read "无法判断安装方式" for an agent installed with npm install -g. howInstalled decided from the binary's path, and a mise shim leads nowhere near node_modules: on a Mac or Linux it is a symlink to the mise binary; on Windows a copy of mise-shim.exe (exe mode, the default), a .cmd plus a bash script running `mise x --` (file), or a hard or symbolic link to mise.exe. A shim is now recognised (a link to mise, or a file in mise's shims folder: parent "mise", a .mode file, or MISE_DATA_DIR/shims) and mise is asked which program it runs, `mise which <cmd>` from the home folder; how it was installed is read from that program. On Windows mise names npm's extensionless sh script, so the .cmd beside it is used. The update runs that Node version's own npm with --prefix, then `mise reshim`: on Windows npm install -g makes no shim for a new command (seen on the box), mise's Unix npm wrapper reshims itself, so it is harmless there. Siblings: - asdf shims (scripts with "# asdf-plugin:" and `exec asdf exec`) are asked with `asdf which` the same way; asdf-nodejs's npm reshims itself and asdf has no Windows build. - proc.UserBinDirs on Windows also looks in mise's shims folder (MISE_DATA_DIR, else XDG_DATA_HOME\mise, which mise follows on Windows, else %LOCALAPPDATA%\mise) for an agent PATH doesn't reach. - Install side: npmIn accepts npm.exe beside node as well as npm.cmd. - WSL agents get no update path (CLI skips them) and wsl.go's probe already lists mise/asdf shims: unchanged. - MISE_DATA_DIR and ASDF_DIR join agentenv.Vars, so a test sandbox clears them (TestFolderVarsAreListed). Fixtures are real bytes: internal/agent/testdata/mise-windows from mise 2026.10.7 on the Windows box (file-mode snow.cmd and snow, .mode files, npm's snow.cmd/snow in the Node folder); the Mac layout and the asdf shim's text from mise 2026.10.7 and asdf 0.20.2 release binaries in a sandbox home. Run: - flp's own layout (where.exe claude: installs\node\24.20.0\claude, claude.cmd, shims\claude.exe; mise which claude names the extensionless script): TestMiseShimWindowsFiveAgents covers claude, pi, codex, opencode and codebuddy through shims\<cmd>.exe; run on the Windows box, red with the fix removed by hand, green restored. - go test -tags nogui ./internal/agent ./internal/proc -run 'Shim|HowInstalled|UpdateCLI|NpmIn|InstalledVersion'; with installedAt skipping the shim by hand TestMiseShimIsNodesNpm, TestUpdateCLIThroughMiseShim and TestAsdfShimIsNodesNpm go red, green again restored. - Real mise on the Mac (sandbox home, mise 2026.10.7, node 22.23.3, snow-ai): detection through the real shim and `mise which`, and a real update 0.9.1 -> 0.9.2 through UpdateCLI. - Real mise on Windows (the box, sandbox USERPROFILE/LOCALAPPDATA, mise 2026.10.7, node 22.23.3, snow-ai): the Windows test binary's unit tests (TestMiseShimWindows, TestHowInstalledWindowsShim, TestNpmIn) pass; a temporary test through the real shim in exe, file and hardlink modes found npm.cmd --prefix <node>, version 0.9.2; after npm install -g snow-ai@0.9.1 a real UpdateCLI took it to 0.9.2 and reshimmed; snow.exe ran 0.9.2. Symlink mode was not tried (needs developer mode); it is the link-to-mise case the Mac covers. flp's own machine was not tried. - go test -tags nogui -timeout 40m ./...; gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui ./... |
||
|
|
06420a7121 |
tests: a fake program is a file macOS has already let run (testenv.Program), so a fake's first start no longer eats a test's wait under load
macOS checks a newly written executable before its first exec: 0.27s alone, 2-5s while other new programs start (a go test ./... starting its test binaries). The same file again takes 0.009s, and the pass is kept across a rename and an in-place rewrite. |
||
|
|
21702d01ff |
Add German translation; harden paths against unset env vars (#770)
* Add German translation and harden paths against unset env vars Add a German locale to the GUI, tray menu, usage alerts and website home page, and refuse to start when the home folder is unset or relative so nothing is written under the working folder; the pi plugin no longer adopts the user's PI_CODING_AGENT_DIR, and an inherited APPIMAGE no longer selects portable mode. Scripts refuse to run from the wrong folder or empty a shared out folder, and a new internal/testenv sandboxes every test package from the user's real files, which also fixes the Claude picker and Termux installer tests on Windows. * Makefile: know magpie's folder by its go.mod, so paths with spaces work The check compared $(CURDIR) with $(dir $(abspath …)), which make splits on spaces, so a checkout under 'My Projects' or 'John Doe' refused every target. It now reads go.mod relative to the working folder and wants magpie's module there: make -C and a symlinked Makefile work, make -f from another folder still stops before any recipe runs. * i18n: German for the strings main added since, with a parity test 75 strings main added (group order, patterns, slow-start wait, usage caps, RTK savings …) get their German, and two that main dropped go. gui-de.test.cjs checks, as gui-ja does, that de has every zh string with its placeholders and tags, and that the window reads in German when picked or on a German system. * appdir: ignore relative folder variables when reading, keep them for children CheckEnv no longer unsets anything. magpie reads the XDG folders, APPDATA/LOCALAPPDATA and every agent's folder variable through appdir.Getenv/LookupEnv, which pass over a relative value; the environment stays as it is, so the agents magpie starts get the variable as the user set it. That covers what proc.UserPath lends from the login shell too, which is set after main's check and reached the desktop app unchecked. On Windows a path rooted on the current drive (\Users\x, Git Bash's /c/x) counts as usable, and magpie version and help answer without a home, before run makes any folder. * Sandbox the tests main added since internal/wslrun gets testenv's TestMain, and four tests main added that set HOME alone set their home with testenv.SetHome, so on Windows they don't read the runner's profile through USERPROFILE. * agentenv: PI_CONFIG_DIR and OPENCODE_DB take relative names on purpose omp puts $PI_CONFIG_DIR under the home and OpenCode a relative $OPENCODE_DB in its data folder, so neither depends on the working folder: appdir no longer passes them over. * i18n: German for the Library's multi-select and System One's decision API The 19 strings main added since (#791's skill multi-select, the decision API snippets) get their German; the one main replaced (four APIs → five APIs) goes. * appdir: tidy the import into magpie's group; say what Go makes of /c/x The appdir import joins the group of magpie's own imports where a file has one. rooted's comment now says that Go takes a Git Bash path like /c/x as \c\x on the current drive, not C:\x. |
||
|
|
f24ee8b06d |
fix(agent): installs without Node ask for it the way that works (#774)
* fix(agent): installs without Node ask for it the way that works The commands that install Node first, for a machine without it (#727), failed in ways that say nothing about the real problem. On a Mac or Linux, `curl -o- … | bash` keeps going when the download fails: a pipe's status is the last command's, so blocked or 404'd (raw.githubusercontent.com is commonly unreachable), bash reads nothing, still exits 0, and the user is told `nvm.sh: No such file or directory` — the network's fault told as a missing file. The vendor commands beside it all curl with -f (install.go's own scripts do); this one now does too, so a failed download stops the line with curl's own words. On Windows, winget asks to accept the msstore source's agreements the first time it runs, which waits for input a copy-pasted command can't give: Node isn't installed, and npm.cmd isn't found. The command now carries --accept-source-agreements and --accept-package-agreements, the flags Microsoft documents for unattended installs; they are idempotent where the source is already accepted. TestInstallCommandsWithoutNode expects the two commands as they now stand, and fails on the old ones ("curl -o- …" and the winget line without the flags, on darwin, linux and windows alike); TestInstallWithoutNodeParses still reads each line with `bash -n`. Validation on Windows: go test ./internal/agent under a temp HOME leaves the three Unix-only failures the base commit leaves (TestCodexStaleOnly ForMagpiesChange, TestSuffixModesReachAgentFiles, TestWSLProbeScript SaysWhere); go vet ./internal/... and the darwin, linux and windows builds pass. * fix(agent): a failed Node download stops the line where it failed yetone's review of the first cut: `curl -fsSL … | bash` doesn't stop at a failed download either, and my claim that -f alone fixes it was wrong — a pipe's status is the shell's, bash reading nothing exits 0, and the && chain goes on to source nvm.sh, which reports the missing file exactly as before. Reproduced against a 404 server on this machine: `curl: (22) … 404` then `bash: …/.nvm/nvm.sh: No such file or directory`. The command downloads to a file now and runs that: a failed download ends the chain at curl, with curl's own words about why. pipefail isn't an option — the line is pasted into the user's own shell, and not every one of them sets it. TestInstallWithoutNodeStopsWhenTheDownloadFails runs the real line, against a local 404 server with a temporary HOME, on each POSIX shell here: the old line failed with the download's error *and* nvm.sh missing, the new one stops at curl's own error and never mentions nvm.sh. It is skipped where there is no curl. TestInstallCommandsWithoutNode expects the line as it now stands. Validation on Windows: go test ./internal/agent under a temp HOME leaves the three Unix-only failures the base commit leaves (TestCodexStaleOnly ForMagpiesChange, TestSuffixModesReachAgentFiles, TestWSLProbeScript SaysWhere); go vet ./internal/..., the darwin, GOOS=linux and GOOS=windows builds pass. |
||
|
|
d51d314ac5 |
agent: with no Node.js on the machine, Install another agent's npm commands install Node first, in the same line (#727, Sun1090 on v0.1.801: "没写curl的命令… curl xxx && npm xxxx", confirmed as option 1 — Pi, Copilot CLI, Crush and the rest had only npm install -g …, which a new machine without Node can't run) — installCommands now takes whether npm is here (nodeHere: exec.LookPath("npm"), then the folders proc.UserBinDirs knows — nvm's, fnm's, mise's, volta's, Homebrew's, the ~/.npmrc prefix — and on Windows also the registry's PATH (proc.LoginPath) and %ProgramFiles%\nodejs; npm.cmd there), and where it isn't, npmInstall gives on a Mac or Linux export NVM_DIR="$HOME/.nvm" && mkdir -p "$NVM_DIR" && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash && . "$NVM_DIR/nvm.sh" && nvm install --lts && npm install -g <pkg> (nodejs.org's nvm route; NVM_DIR is set because the installer goes by $XDG_CONFIG_HOME/nvm when that is set, and nvm.sh is read in the same shell since the profile line only reaches new terminals; nvm's Node is the user's, so no sudo), and on Windows, for PowerShell, winget install -e --id OpenJS.NodeJS.LTS; $env:Path = <Machine + User Path from the registry>; npm.cmd install -g <pkg> (";" as Windows PowerShell 5.1 has no "&&", PATH re-read since the MSI only adds Node to new terminals, npm.cmd since npm.ps1 is refused under the default execution policy). Each such command carries node (nvm, nvm-mac or winget); the row labels it "Node.js + npm" and the note says the npm commands install Node with nvm/winget first — on a Mac that nvm's installer stops without Xcode's Command Line Tools (run xcode-select --install), on Windows to run them in PowerShell and open a new terminal if npm still isn't found. With Node here everything is as before. magpie still only shows commands to copy (the list never had a one-click install; the page's Update all/update pill run only for CLIs already installed, unchanged). The via column is 84px so "Node.js + npm" stays on one line. TestInstallCommandsWithoutNode (Pi on darwin/linux/windows, Claude's installer untouched, npm alone with Node), TestNpmIn and TestInstallWithoutNodeParses (bash/zsh/sh -n read the line) are new; agent-update-all.test.cjs gains "no Node.js here" (label, note with/without Xcode, the whole line copied, no sideways scroll, winget note in Chinese) and passes in WebKit (8 tests). go vet ./internal/..., builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass but for TestCursorSignInJoinsAWrappedLink, which timed out under load and passes alone. Nothing was installed: the commands were only parsed, not run, and not tried on a machine without Node.
|
||
|
|
e85886c760 | gui: the Agents page updates every agent's CLI at once, and lists the agents not on this machine with their vendors' install commands (#727, Sun1090: on a new machine with no agent installed magpie gave no install commands or how-to, and agents updated only one at a time, where cc-switch has both) — Update all: with two or more CLIs behind (#202's cliInfo update), a line above the list says which and offers Update all, which runs the existing per-agent update (POST /api/agents/cli/{id}, updateCLI, now returning why it failed and quiet for the run) for each, one after another (two global npm installs at once can trip over each other's folders), each row's pill busy in its turn, then says how it went ("2 of 3 agents updated · 1 didn't: Gemini CLI", the errors in its tooltip and the status pill). Once shown the line stays until the agents are read again (load), saying what is left ("Crush has an update", "Every agent is up to date"), so neither its click nor a row's own pill moves the list under the reader. Install: agent.Installs (internal/agent/install.go) lists the agents magpie knows that aren't detected (not WSL twins) with their commands: the vendor's installer first where its docs give one (Claude Code's claude.ai/install.sh, install.ps1 on Windows; Codex's chatgpt.com/codex/install.sh, install.ps1, and brew --cask codex on a Mac; OpenCode's opencode.ai/install; Gemini CLI's brew formula), then npm install -g of the package cliSpecs already updates from (pi, omp, copilot, crush, cline, omo too); GET /api/agents/install serves it. Under the list, "Install another agent (n)" unrolls them (open when no agent is here at all), each command with a copy button and a note that npm needs Node.js and magpie lists the agent once installed. magpie doesn't run the installs: a new machine may have no Node.js or Homebrew yet and the update machinery derives its command from where an installed binary is, so the commands are to copy. zh strings for every new one. TestInstallCommands and TestInstallsOnlyMissing pass; agent-update-all.test.cjs (webkit: Update all runs three in order never two at once, a failure named, the page and list not moved, a row's own pill leaves the line in place, one behind gets no Update all, the install list folded under the list without the installed Codex, copy sends the command, open with no agents, Chinese) passes and fails on the old code. Webkit agent-connect, agent-connected-unfolded, agent-disconnect, agent-grip, agent-layout, agent-tweak-fold, click-scroll, copy-command, show-unset-agent, panel-fold, cli-behind pass; cli-update's tight-row subtest fails the same on the old code. go vet ./internal/..., go build -tags nogui ./..., GOOS=windows and GOOS=linux builds pass; the full go test under a temp HOME was not run here (the sandbox refused the HOME override) — internal/agent's install/version tests and internal/gui's asset tests pass. Not tried in the reporter's app. |