bjzhangwn on X: magpie supported CodeBuddy only as its CLI, not the IDE.
The CodeBuddy IDE (4.12.2, codebuddy.ai's CodeBuddy.app,
com.tencent.codebuddy, and codebuddy.cn's CodeBuddy CN.app,
com.tencent.codebuddycn) reads the file magpie already writes for the
CLI: its genie extension's CustomModelsProductProvider loads
~/.codebuddy/models.json's "models" (a string id and url each) and
"availableModels", and lists them in its own picker. So one row,
renamed CodeBuddy, stands for both. desktopApps gets a "codebuddy"
entry, with a "more" list for the second build's bundle id. A `sign`
lists the row with only the IDE installed. That row shows the IDE's
version, is never "CLI not found", and the CLI isn't offered for install.
Tests: TestCodeBuddyIDEIsCodeBuddy uses the real Info.plist bytes of
both builds, cut to their first keys. TestCodeBuddyIDEReadsMagpieModels
reads the written models.json the way the IDE's loader does.
Run (mote, macOS 27):
- gofmt -l: clean.
- GOOS=linux and GOOS=windows go vet of ./internal/agent/... and
./internal/sessions/..., plus GOOS=windows -tags nogui ./internal/gui:
ok.
- go test -timeout 45m -count=1 ./... at d4f1d6480 plus this change:
76 packages ok. One red, internal/gui TestMainWindowCorners/macOS_26_SDK,
is #3949 (macOS 27, same output, untouched here).
- Rebased on origin/main 2ff85f8a2: internal/agent and internal/sessions
ok again at the pushed head.
- Broken by hand, TestCodeBuddyIDEIsCodeBuddy goes red each way: with
the sign off, and with the CN bundle id wrong.
Real app: the 4.12.2 builds (intl, then CN) ran on mote under a sandbox
HOME with --user-data-dir. Both logged "Loaded custom models config from
user: <home>/.codebuddy/models.json, valid=1" for magpie's entry.
Not tried:
- Hot reload is unconfirmed. In the not-signed-in sandbox, neither a
rename nor an in-place edit made it load again (the cloud product
fetch never finished), though its code fs.watches the file and
debounces a sync.
- No chat through the gateway: it needs a CodeBuddy sign-in.
- The IDE's Windows and Linux install paths, so off a Mac it is found
by ~/.codebuddy alone.
- The IDE ignores CODEBUDDY_CONFIG_DIR.
CodeBuddy Code keeps its sessions as WorkBuddy does, ~/.codebuddy/projects/<cwd>/<id>.jsonl. magpie read them for the calls ledger (#1779) but never listed them: allFiles() and Dirs() left them out, parserFor sent them to the Claude parser, and Deletable didn't name the agent. caozeal's branch (85cc186a2) adds them to allFiles, Dirs, parserFor (workbuddyLine) and Deletable, with the meta cwd fallback WorkBuddy has, and the ledger reads through the same list. On top of it: the resume command is `codebuddy --resume <id>` (its CLI's `-r, --resume [sessionId]`, read from @tencent-ai/codebuddy-code 2.168.2's dist/codebuddy.js; codebuddy is one of the package's three bins). The Sessions page's and Usage > Sessions' agent label come from the agent registry (CodeBuddy Code, codebuddy-color) and needed no change; a test now holds them.
Fixtures are the real `codebuddy -p` runs already in internal/sessions/testdata/codebuddy (#1779).
Tests:
- TestCodeBuddy (caozeal's, extended): two sessions with their cwd, title and model tokens; the resume command on each OS's form; Deletable.
- TestCodeBuddySessionsListedUnderTheirName (new, internal/gui): /api/sessions, /api/sessions/manage and /api/sessions/stats name them CodeBuddy Code with its icon, resume command and trash.
- Broken by hand, each red: allFiles reverted and parserFor reverted ("want 2 CodeBuddy Code sessions, got 0" in both tests), resume reverted (resume ""), Deletable reverted ("not deletable", "offers no trash").
Run at e085d6e92 plus this change:
- gofmt -l internal/: clean. go vet ./... (darwin): exit 0. GOOS=linux and GOOS=windows go vet -tags nogui ./...: exit 0.
- go test -tags nogui -timeout 45m ./... under set -o pipefail: 64 packages ok, 2 red at load average ~110, neither ours:
- internal/agent timed out at 45m (TestWSLMoreAgentsPick running; 2702.7s), recorded on #2544.
- internal/gui TestRestartWhenIdle "restarted in a tool chain's gap" (30ms sleep vs 80ms idleSettle); passes -count=10 alone; filed #2673.
- After rebasing onto origin/main 7660399a1 (#2576, #2578: gateway model list, gui Claude Desktop chip): internal/sessions ok (169.6s) and internal/gui ok (303.7s) at the rebased head on 7660399a1.
Co-authored-by: caozeal <21231607+caozeal@users.noreply.github.com>