Files
lxcong 70216060ea fix(install): always run auth-login, drop stale already_authed check
The installer was sniffing config files for "agentkey" + an
"AGENTKEY_API_KEY": "ak_..." env-shaped pair to short-circuit MCP
auth. After --auth-login switched to writing a remote-HTTP MCP block
("Authorization": "Bearer ak_...") the check went stale in both
directions:

  - users still holding a stdio-shaped config from older releases
    matched the regex and were told "AgentKey is already configured
    in an MCP client config — skipping auth", but their MCP block no
    longer works because the stdio runtime is gone
  - users who had successfully re-authed into the new HTTP shape no
    longer matched and got asked to re-auth on every installer run

The simplest fix is to delete the heuristic. `@agentkey/cli
--auth-login` is the source of truth for whether a fresh device-code
round-trip is needed; the installer should hand control to the CLI
instead of guessing from on-disk shape.

Removes:
  - already_authed() in install.sh, Test-AlreadyAuthed in install.ps1
  - --force-mcp / -ForceMcp flags (no longer meaningful)
  - "Re-authenticate even if AgentKey is already configured locally"
    documentation in README.md / docs/README_zh.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 17:15:09 +08:00
..