Files
magpie/docs
yetoneandcaozeal cb05dc2d1b sessions: CodeBuddy Code's own sessions are listed on the Sessions page, resumed with codebuddy --resume and deletable (#2657, caozeal)
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>
2026-10-17 14:05:17 +08:00
..