Files
magpie/docs
yetone 5be7d05d28 agent: Desktop on magpie offers its own import of the signed-in sessions (lambdua on X)
lambdua on X: "claude Code桌面端支持么? 我桌面端切换账号,对话都能全都不见".
Nothing is lost. Desktop on magpie runs in 3p mode, whose userData is
Claude-3p, a folder apart from Claude/. Desktop 2.7032 keys Code and
Cowork sessions by account and org (claude-code-sessions/<acct>/<org>):
in 1p the claude.ai login's, in 3p the install id in ant-did and a fixed
org. So the sessions made signed in stay in Claude/ untouched and show
again when Desktop is switched back; claude.ai chats are on Anthropic's
servers. magpie's on/off never writes or removes a session (desktopOff
removes only what magpie made, and only when empty).

Desktop has its own importer (Settings -> Import: the signed-in userData,
other Claude* folders, ~/.claude/projects; copies under new ids, originals
left), but in 3p only when the profile's claudeAiImport.enabled is true
(3p-only policy, default off, since 1.28929.0). magpie's profile now gets
"claudeAiImport":{"enabled":true,"bannerBehavior":"detect"} once per
folder set (desktopSeedImport, stash mark claude-desktop.import): on the
switch on, and from Sync at magpie's start for a Desktop already on
magpie. A claudeAiImport already there is kept; one the user removes is
not written back (the mark is read, never unstashed).

Run (suite at origin/main 5df62c5cd, then rebased on 2f44e075a):
- go test ./internal/agent/ -run Desktop -count=1: ok.
- go test ./... -timeout 45m -count=1 at 5df62c5cd (log kept whole):
  every package ok but two reds already on main and filed:
  TestFolderVarsAreListed (#3600, fixed in 2f44e075a) and
  TestNoCommandBypassesProc (#3567, internal/tui/keep.go, open).
- after the rebase onto 2f44e075a: go test ./internal/agent/
  ./internal/proc/ -count=1: agent ok; proc red on #3567 only.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/agent/
  ok; GOOS=windows go build ./... ok; GOOS=linux go build ./internal/agent/
  ok (the CLI and GUI need Wails' cgo, not cross-built here).
Broken by hand:
- desktopSeedImport returning at once (the old code): TestClaudeDesktopFresh,
  TestClaudeDesktopOnKeepsTheUsersOwnGatewayProfile and the new
  TestClaudeDesktopOffersItsSessionImport go red.
- the mark read with unstash (consumed on read): the new test goes red
  with "seeded again over the user's choice". My first draft had this
  bug; the test found it.
Schema checked in Desktop 2.7032's asar (read-only, extracted to a
scratchpad): claudeAiImport is a flat leaf key whose value is the object
{enabled, bannerBehavior}, gated in 3p on enabled === true.
Not tried: a real Desktop in 3p mode with the key (would mean running
Desktop against the live userData); the live Claude folders were only read.
2026-10-25 20:29:08 +08:00
..