Riko switched Claude off in Providers, and magpie still ran
`claude auth status --json` about every minute. Off only kept the
gateway from routing to it. Every page and request lists accounts,
which re-asked the CLI, and the background loops went on reading
allowances, renewing, switching, warming, checking in and fetching lists.
The same held for each sibling with a CLI or account check: Cursor
(`cursor-agent about`), Devin (`devin auth status`) and the rest.
What changed:
- left_alone.go: leftAlone(id), true for a provider that is Off or
Hidden (account removed).
- account.go claudeIdentity and cli_identity.go get (Cursor, Devin): the
CLI isn't asked; what it said last (memory or cli-identity.json) is
served, so the account stays listed to switch on again.
- subscription_usage.go: claude, cursor and grok are checked as hidden
before their account is looked up (the look-up ran the CLI).
- login_usage.go loginUsageAt, keepalive.go RenewLogins,
codex_switch.go NextLogin, codex_warmup.go keepWarm: leftAlone where
only accountRemoved (or nothing) was checked.
- models.go newDue: a provider that is off has no list fetched.
- checkin.go: each check-in account knows its card's provider; the loop
skips one that is left alone, a press still checks it in (minimax,
trae, qoder, workbuddy, plugin check-ins set it).
- docs/subsystems/providers-accounts.md says so.
Not covered: KeepPluginsListed lists every plugin at once in the host. A
Cursor switched off that was never asked who is signed in isn't listed
until switched on.
What was run:
- TestLeftAloneRunsNoCLI: fake claude, cursor-agent and devin on PATH log
each run; with claude and cursor off and devin removed, All, Hidden,
fetchSubscriptionUsage, LoginUsage, RenewLogins, SwitchWhenSpent and
FetchNew run three times over stale caches and no CLI is run; switched
back on, all three are asked again.
- Break check: with the source changes reverted it fails with
"switched off or removed, the CLIs were run: [claude_auth_status_--json
cursor-agent_about_--format_json devin_auth_status ...]"; with only the
claude gate removed only claude is logged, with only cliIdentity's only
cursor and devin.
- go test -tags nogui -timeout 45m ./internal/provider ./internal/gateway:
ok (399s, 1271s).
- gofmt -l: clean. go vet (darwin), GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./...: clean, under set -o pipefail.
What changed: Settings → Privacy → Subscription accounts (On/Off),
`magpie accounts discovery [on|off]` and MAGPIE_NO_ACCOUNTS=1 turn off
account discovery. It stays on by default. While it is off, magpie reads
none of the agents' sign-ins: ~/.claude/.credentials.json, .claude.json's
account, ~/.codex/auth.json, Copilot's, Cursor's, Devin's, Kiro's,
Gemini's, ZCode's, Command Code's and OpenCode's files. It runs no
`security` / `secret-tool` for the Keychain or Secret Service, and asks no
agent CLI who is signed in. It serves no subscription. API-key providers,
middleware plugins and Pi extensions work as before.
Why: the reporter runs magpie on machines where reading other tools'
credentials isn't wanted. The owner delegated the call.
How: settings.NoAccountDiscovery (kept per computer by KeepOwn) and
settings.AccountDiscoveryOff(). The variable only ever turns discovery
off. The gates sit at every reader (readAccountFile, discoveryOff) and at
every route that reads or writes a sign-in, so a route that skips
Accounts still reads nothing:
- Accounts, All, Logins, usage, renewal, warm-up, session identities,
check-ins;
- switching, forgetting, SetLoginOn, StartSignIn, the imports;
- moves onto plugins.
The ones that write refuse with an error that names how to turn it back
on. On the agent side, Agent.Source and OpenCode's auth.json are gated,
and Codex wiring goes by magpie's stash instead of auth.json, so a
toggle never rewires Codex. logins.json and plugin-auth.json are left
untouched and serve again when discovery is turned back on. A change
applies at once (ForgetAccounts).
Docs: providers-accounts.md, README (en, zh-CN), and the site's CLI table
(en, zh, ja).
Run:
- TestAccountDiscoveryOffReadsNoSignIn (provider) and
TestAccountDiscoveryOffAgentsReadNoSignIn (agent). Every credential
path is a FIFO that records each open, and security, secret-tool,
claude, codex, cursor-agent, devin, kiro-cli, copilot and grok are fakes
on PATH. Both fail with the gate removed: they show the opens and
`security find-generic-password -s Claude Code-credentials`, among
others. Both pass with the gate in place.
- TestAccountDiscoverySetting and TestAccountsDiscoveryCmd.
- account-discovery.test.cjs: chromium and webkit, 900 and 360 wide,
en/zh/zh-TW/ja/de, 32/32. The neighbouring privacy, redact,
settings-sections and i18n-keys GUI tests: 49/49.
- The full `go test -tags nogui ./...`, gofmt -l, and go vet for darwin,
linux and windows on the touched packages.
Not tried: a real machine under fs_usage, and Linux and Windows at
runtime. The FIFO tests are !windows.