mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-11-23 04:11:02 +00:00
A stale sk- key in ~/.hanzo/config.json beat the person's login because the file was read before the hanzo CLI was asked. Every Python tool had its own copy of that order, and research ran whatever `hanzo` was first on PATH, which on Debian is the hanzo-ide GUI. hanzo-login (stdlib only) is the one resolver: HANZO_API_KEY, then the CLI's login at ~/.local/bin/hanzo (`auth token`, `--as` for another identity, kept 300 s per identity), then config.json apiKey last. An identity named per call or with use() always asks the login and never falls through to another account. Identities are validated before they reach argv. The CLI owns its store; nothing here reads it. HanzoCloud resolves per request, so a refreshed or switched login is followed, takes identity and org (X-Org-Id) per call, and sends hanzo-tools/<version>. hanzo-research and HanzoSession call the same resolver instead of their own. The hanzo router answers service="auth" locally: whoami (source, identity, email, name, org, orgs, a key's prefix only), list, use (this process) and switch (the machine). Every call takes `as` and `org`. params is now declared as an object or its string: FastMCP parsed the JSON string into a dict and refused it against a str-only schema. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk