chore(cloud): drop the legacy ~/.agent-relay auth fallback#1178
Conversation
The canonical cloud-auth store moved to ~/.agentworkforce/relay/cloud-auth.json some releases ago; `.agent-relay` only survived as LEGACY_AUTH_FILE_PATH plus a migrate-on-read shim in readStoredAuth. Remove both so the workforce CLI never reads or writes a ~/.agent-relay directory. - types.ts: delete LEGACY_AUTH_FILE_PATH. - auth.ts: drop the legacy import and the legacy read/migrate-on-read branch; readStoredAuth now resolves env auth, then the canonical file, else null. - index.ts: stop re-exporting LEGACY_AUTH_FILE_PATH. - auth.test.ts: replace the migrate-from-legacy test with one asserting the legacy .agent-relay path is never read and no write/rename occurs. Scope: auth store only. Other unrelated ~/.agent-relay directories (sandbox runtime state, telemetry, binary cache, workflow run-db) are tracked separately. BREAKING (minor): a machine whose creds exist ONLY at the old ~/.agent-relay/cloud-auth.json (never re-authed since the move) will no longer be auto-migrated and must re-run `agentworkforce login`. `agent-relay update`/ uninstall still cleans up the old `.agent-relay` dir (core-maintenance.ts). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughRemoves ChangesLegacy Auth Path Removal
Possibly related issues
Possibly related PRs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request removes the legacy migrate-on-read shim for authentication files. Specifically, it deletes the LEGACY_AUTH_FILE_PATH constant, removes the fallback logic in readStoredAuth that migrated legacy .agent-relay authentication files to the canonical .agentworkforce/relay path, and updates the corresponding unit tests to verify that legacy paths are no longer read or written. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What
Removes the last
.agent-relayreference in the cloud auth store. The canonical credential file already moved to~/.agentworkforce/relay/cloud-auth.json;.agent-relayonly lingered asLEGACY_AUTH_FILE_PATH+ a migrate-on-read shim. This deletes both so the CLI never reads/writes a~/.agent-relaydirectory for auth.Changes (
packages/cloud)types.ts— deleteLEGACY_AUTH_FILE_PATH.auth.ts— drop the legacy import and the legacy read/migrate-on-read branch.readStoredAuthnow = env auth → canonical file →null.index.ts— stop re-exportingLEGACY_AUTH_FILE_PATH.auth.test.ts— replace the "migrates legacy auth" test with one asserting the.agent-relaypath is never read and no write/rename happens.Scope
Auth store only, by request. The other, unrelated
~/.agent-relaydirectories — 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-relayinstall dir (core-maintenance.tskeeps it inINSTALL_DIR_NAMESon purpose — that helps eliminate it from machines).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-runagentworkforce 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-relayconstant lingering elsewhere).Verified
npm --prefix packages/cloud run build(tsc) clean.vitest run packages/cloud/src/auth.test.ts→ 25/25 pass.LEGACY_AUTH_FILE_PATHreferences in source.Follow-ups (not in this PR)
pear/pear-mobilesrc/main/auth.tsstill mention the~/.agent-relayfallback (separate repos, comment-only)..agent-relaydirs acrosscloud/relay-broker/relay-tui/relayfile/relayflows.🤖 Generated with Claude Code