教父 on Discord (MiniMax Code 3.1.10, magpie v0.1.2629 and v0.1.2679):
MiniMax Code turned on in magpie's Agents page with a model picked, and
MiniMax Code went on with the user's own MiniMax-M3.1-Flash; Sessions
showed nothing.
3.1.10 is MiniMax Code Desktop (Electron, MiniMax Code.app). It runs the
mcode runtime on the same ~/.minimax/config.yaml magpie writes, and that
write is right: defaultModel is custom_provider:magpie/<model>. But
Desktop's window keeps the global model last picked in it in Chromium
localStorage ("mavis:model-selection", read from 3.1.10's renderer chunk
56321) and, when the model list loads, marks that one selected while it
is still in the runtime's list, ignoring the runtime's own default.
Only a session.model_updated from the runtime's own select API moves it,
and the runtime reads config.yaml at start-up and doesn't watch it. A
release build has no local HTTP API (local-runtime's server listens only
with the diagnostic sidecar env set), so magpie can't move the pick, and
writing the app's leveldb would risk the user's app data. Nothing changed
here between v0.1.2629 and main (only 35c47f762's dsh YAML speed-up).
What changed:
- desktopApps knows MiniMax Code Desktop: MiniMax Code.app with bundle id
com.minimax.agent.cn (filecdn.minimax.chat) or com.minimax.agent
(file.cdn.minimax.io), and on Windows electron-builder's per-user
default %LOCALAPPDATA%\Programs\MiniMax Code\MiniMax Code.exe. So its
version shows beside the CLI's, and ~/.minimax isn't a leftover there.
- With the app installed, MiniMax Code's notice says to restart the app
and pick a magpie model once in its model menu (under magpie); mcode
sessions still need a restart. Translated in zh, zh-TW, ja and de.
- agent-wiring.md says why.
Run (on mote) at the first base d24be3c25: go test -count=1 ./internal/agent
./internal/sessions . ok; ./internal/gui red only in TestMainWindowCorners/macOS_26_SDK, which
is #3949 (macOS 27, AppKit, unrelated). go vet ./internal/agent for
darwin, linux and windows ok; gofmt -l clean; node --test of
i18n-keys, agent-notice-lang and about-notices all pass.
Broken by hand: with the desktopApps entry renamed away,
TestMiniMaxDesktopSaysPickInTheApp goes red (no notice, no version) for
both bundle ids.
At the rebased tree (on d577c184b): go test -count=1 ./internal/agent ok,
the three node GUI files pass, linux and windows go vet ok.
Not tried: the Desktop app itself (an Electron GUI with sign-in; read
from its 3.1.10 zip, whose SHA-512 matches latest-mac.yml, never run).
The Windows install folder is electron-builder's default, not read from
an install. A data folder moved in Desktop's settings (desktop_custom)
is still not followed: magpie writes ~/.minimax or $MINIMAX_DATA_DIR.
Reported by 教父 on Discord.
91 lines
3.3 KiB
Go
91 lines
3.3 KiB
Go
package agent
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// miniMaxDesktopPlist is MiniMax Code Desktop 3.1.10's Info.plist (MiniMax
|
|
// Code-3.1.10-arm64-mac.zip from filecdn.minimax.chat, the China build) cut
|
|
// to the keys magpie reads, in their order and indentation. The
|
|
// international build (file.cdn.minimax.io) is the same bundle name with
|
|
// the id com.minimax.agent (app-identity.js).
|
|
const miniMaxDesktopPlist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>CFBundleDisplayName</key>
|
|
<string>MiniMax Code</string>
|
|
<key>CFBundleExecutable</key>
|
|
<string>MiniMax Code</string>
|
|
<key>CFBundleIdentifier</key>
|
|
<string>com.minimax.agent.cn</string>
|
|
<key>CFBundleName</key>
|
|
<string>MiniMax Code</string>
|
|
<key>CFBundleShortVersionString</key>
|
|
<string>3.1.10</string>
|
|
</dict>
|
|
</plist>
|
|
`
|
|
|
|
// 教父 on Discord (MiniMax Code 3.1.10, magpie v0.1.2629 and v0.1.2679):
|
|
// MiniMax Code turned on in magpie with a model picked, and the desktop app
|
|
// went on with the user's own MiniMax-M3.1-Flash; Sessions showed nothing.
|
|
// Desktop's window keeps the model last picked in it and shows that, not
|
|
// config.yaml's defaultModel, while that model is still listed. So with the
|
|
// desktop app installed, either build, magpie's notice says to restart it
|
|
// and pick a magpie model once in its menu, and its version is shown.
|
|
// Without it the mcode advice stays as it was.
|
|
func TestMiniMaxDesktopSaysPickInTheApp(t *testing.T) {
|
|
home, _ := miniMaxHome(t)
|
|
apps := t.TempDir()
|
|
wasFolders, wasSpot, wasRunning := appFolders, spotlightApps, Running
|
|
appFolders = func() []string { return []string{apps} }
|
|
spotlightApps = func(string) []string { return nil }
|
|
t.Cleanup(func() { appFolders, spotlightApps, Running = wasFolders, wasSpot, wasRunning })
|
|
mcode := false
|
|
Running = func(...string) bool { return mcode }
|
|
|
|
a := miniMax(home)
|
|
if n := a.Notice(); n != "" {
|
|
t.Fatalf("no app, no mcode running: notice %q", n)
|
|
}
|
|
mcode = true
|
|
if n := a.Notice(); n != noticeMinimax.String() {
|
|
t.Fatalf("no app, mcode running: notice %q", n)
|
|
}
|
|
|
|
for _, id := range []string{"com.minimax.agent.cn", "com.minimax.agent"} {
|
|
bundle := filepath.Join(apps, "MiniMax Code.app")
|
|
os.RemoveAll(bundle)
|
|
if err := os.MkdirAll(filepath.Join(bundle, "Contents"), 0o755); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
plist := strings.Replace(miniMaxDesktopPlist, "com.minimax.agent.cn", id, 1)
|
|
if err := os.WriteFile(filepath.Join(bundle, "Contents", "Info.plist"), []byte(plist), 0o644); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, running := range []bool{false, true} {
|
|
mcode = running
|
|
if n := a.Notice(); n != noticeMinimaxDesktop.String() {
|
|
t.Errorf("%s installed, mcode running %v: notice %q", id, running, n)
|
|
}
|
|
}
|
|
if v := a.AppVersion(); v != "3.1.10" {
|
|
t.Errorf("%s installed: app version %q", id, v)
|
|
}
|
|
}
|
|
|
|
// another app under the same name is not MiniMax Code's
|
|
plist := strings.Replace(miniMaxDesktopPlist, "com.minimax.agent.cn", "com.example.other", 1)
|
|
if err := os.WriteFile(filepath.Join(apps, "MiniMax Code.app", "Contents", "Info.plist"), []byte(plist), 0o644); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
mcode = false
|
|
if n := a.Notice(); n != "" {
|
|
t.Errorf("another bundle id: notice %q", n)
|
|
}
|
|
}
|