A path through magpie's own screens was written with › in some places and → in others (11-17 scan, item 18). Every one the user reads is now ›: Settings › Network and sharing, Settings › Privacy, Library › MCP servers, Providers › … › Use it anyway, Settings › Usage, in the GUI and in the Go errors and notices that reach it, in every language. The GUI matches errNotAsked by its prefix, so it still finds it. Left as they are: gateway errors written for agents, AiHubMix's and Claude Desktop's own menu paths (their apps' words), the image MCP tool description (it goes to agents), and comments. Own tests: chatgpt-usage-why, websearch-places, library-mcp-hub, i18n-keys; Go: internal/library (TestPrivateRepoInstallsWithToken, red on the first try because skills.go still had →), internal/plugin (notplugin_test), internal/pii, internal/provider. Run (mote, Chromium and WebKit, en zh zh-TW ja de): - before the rebase, 23 GUI files: every one green except plugin-provider-options (my bug, fixed in this branch before the push) and settings-groups' "warm-ups and check-in in each service's provider editor", red the same way at fresh origin/main98c487d09(an extra "Spend extra usage" row; #6597, commented with the sha). - rebased on origin/main98c487d09: advanced-headings, plugin-provider-options, i18n-keys, routing-advanced, provider-prefs, settings-search, panel-profiles, builtins, chatgpt-usage-why, provider-concurrency, websearch-places, library-mcp-hub all green; go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii, plugin, provider and access ok; go vet ok. No budget raised. Again at the pushed head, rebased on origin/main39c5040d7and07d19510f(mote, Chromium and WebKit, every language): advanced-headings, plugin-provider-options, i18n-keys, routing-advanced, provider-prefs, settings-search, panel-profiles, builtins, chatgpt-usage-why, provider-concurrency, websearch-places, library-mcp-hub, codex-client, codex-client-editor and nav-timeout all green; go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii, plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway and agent tests whose strings changed; gofmt -l empty; go vet, GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/... clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only webview_window_linux.go, the same on origin/main 39c5040d7.) Not tried: the real app window, and Linux/Windows runs (cross-OS go vet only).
42 lines
1.8 KiB
Go
42 lines
1.8 KiB
Go
// Account discovery off (#1535, MaxHaiCom): with Settings → Privacy's
|
||
// "Subscription accounts" off, `magpie accounts discovery off`, or
|
||
// MAGPIE_NO_ACCOUNTS=1, magpie reads no agent's sign-in — no
|
||
// ~/.claude/.credentials.json, ~/.codex/auth.json, Copilot, Cursor, Kiro,
|
||
// Devin or other credential file, no Keychain or Secret Service item, and
|
||
// no agent CLI asked who is signed in — and serves no subscription. API-key
|
||
// providers work as before.
|
||
//
|
||
// The gates sit at every source (the readers below Accounts, Logins,
|
||
// usage, renewal, warm-up, session identities) and every sink that would
|
||
// write a sign-in (switching, forgetting, sign-in, imports, moves onto
|
||
// plugins), so a route that skips Accounts still reads nothing. What magpie
|
||
// kept of its own (logins.json, plugin-auth.json) is left as it is, unread
|
||
// and unwritten, and comes back when discovery is turned on again.
|
||
// Middleware plugins and Pi extensions in the plugin host are not
|
||
// subscriptions and run as before, and neither is a public plugin, one
|
||
// whose every way in is keyless (publicPlugin): it holds no account of
|
||
// the user's, so it is listed, signed in and served (lileo0668).
|
||
|
||
package provider
|
||
|
||
import (
|
||
"errors"
|
||
"os"
|
||
|
||
"github.com/yetone/magpie/internal/settings"
|
||
)
|
||
|
||
var errAccountDiscoveryOff = errors.New("subscription accounts are off in magpie (Settings › Privacy, or `magpie accounts discovery on`)")
|
||
|
||
// discoveryOff is whether agents' sign-ins are left unread; see above.
|
||
func discoveryOff() bool { return settings.AccountDiscoveryOff() }
|
||
|
||
// readAccountFile is os.ReadFile for an agent's credential file, refused
|
||
// while discovery is off.
|
||
func readAccountFile(path string) ([]byte, error) {
|
||
if discoveryOff() {
|
||
return nil, errAccountDiscoveryOff
|
||
}
|
||
return os.ReadFile(path)
|
||
}
|