chore(cloud): drop the legacy ~/.agent-relay auth fallback

Merged
WI
5mo ago
+10-47

What

Removes the last .agent-relay reference in the cloud auth store. The canonical credential file already moved to ~/.agentworkforce/relay/cloud-auth.json; .agent-relay only lingered as LEGACY_AUTH_FILE_PATH + a migrate-on-read shim. This deletes both so the CLI never reads/writes a ~/.agent-relay directory for auth.

Changes (packages/cloud)

  • types.ts — delete LEGACY_AUTH_FILE_PATH.
  • auth.ts — drop the legacy import and the legacy read/migrate-on-read branch. readStoredAuth now = env auth → canonical file → null.
  • index.ts — stop re-exporting LEGACY_AUTH_FILE_PATH.
  • auth.test.ts — replace the "migrates legacy auth" test with one asserting the .agent-relay path is never read and no write/rename happens.

Scope

Auth store only, by request. The other, unrelated ~/.agent-relay directories — sandbox runtime state (cloud), telemetry (relay-broker, relay-tui), binary cache (relayfile), workflow run-db (relayflows) — are separate concepts and tracked as a follow-up phase.

agent-relay update/uninstall still removes the old .agent-relay install dir (core-maintenance.ts keeps it in INSTALL_DIR_NAMES on purpose — that helps eliminate it from machines).

⚠️ Behavior change (minor)

A machine whose creds exist only at ~/.agent-relay/cloud-auth.json (never re-authed since the canonical move) will no longer be auto-migrated and must re-run agentworkforce login. Current 4.x users already have creds at ~/.agentworkforce/relay/ and are unaffected. If you'd rather keep the migrate-on-read shim for one more release before deleting, say so and I'll restore just the read (without the .agent-relay constant lingering elsewhere).

Verified

  • npm --prefix packages/cloud run build (tsc) clean.
  • vitest run packages/cloud/src/auth.test.ts → 25/25 pass.
  • No residual LEGACY_AUTH_FILE_PATH references in source.

Follow-ups (not in this PR)

  • Stale doc comments in pear/pear-mobile src/main/auth.ts still mention the ~/.agent-relay fallback (separate repos, comment-only).
  • Phase 2: the 4 non-auth .agent-relay dirs across cloud/relay-broker/relay-tui/relayfile/relayflows.

🤖 Generated with Claude Code