Skip to content

Fix mount daemon cloud refresh token rotation race#179

Merged
khaliqgant merged 1 commit into
mainfrom
codex/issue-178-auth-token-rotation
May 21, 2026
Merged

Fix mount daemon cloud refresh token rotation race#179
khaliqgant merged 1 commit into
mainfrom
codex/issue-178-auth-token-rotation

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • Retry cloud session refresh once with freshly reloaded disk credentials after refresh-token auth rejection.
  • Reuse a fresh on-disk cloud access token when another CLI already rotated credentials.
  • Treat unrecovered refresh endpoint 401/403 as the existing re-login/degraded sentinel instead of a non-fatal refresh blip.
  • Add regression coverage for stale in-memory refresh tokens racing with rotated disk credentials.

Tests

  • go test ./cmd/relayfile-cli -run 'TestRefreshCloudCredentials|TestMountOnceRejoinsWorkspaceTokenAfterUnauthorized|TestStatusSurfacesDegradedStallReason'
  • go test ./cmd/relayfile-cli

Closes #178

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Warning

Rate limit exceeded

@khaliqgant has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 50 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 43c9dc72-11cc-470a-8412-fd30d7dc2766

📥 Commits

Reviewing files that changed from the base of the PR and between 0762c7e and 662f9ad.

📒 Files selected for processing (2)
  • cmd/relayfile-cli/main.go
  • cmd/relayfile-cli/main_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-178-auth-token-rotation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-05-21T10-50-06-576Z-HEAD-provider
Mode: provider
Git SHA: d866e31

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@khaliqgant khaliqgant merged commit f52e238 into main May 21, 2026
9 of 10 checks passed
@khaliqgant khaliqgant deleted the codex/issue-178-auth-token-rotation branch May 21, 2026 10:52
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mount daemon: auth thrash loop on refresh-token rotation with concurrent CLI processes

1 participant