Repository navigation
fix(cliproxyapi): only hydrate auths into an empty cache - #3064
Conversation
Every home-manager switch ran `aws s3 sync` from S3 into the live auth directory. sync overwrites any local file whose size differs, and S3 can lag behind the server's rotated Claude refresh tokens, so a switch on kyber reverted all Claude auths to revoked tokens (invalid_grant) and forced a re-login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
|
Warning This organization's free trial has ended, so Indent couldn't start this review. Manage billing to resume reviews on this repository.
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
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 |

Summary
hydrateCliproxyAuthsranaws s3 sync s3://.../auths/ -> localon every home-manager switch.s3 syncoverwrites any local file whose size differs, regardless of which side is newer.invalid_grant: Refresh token not found or invalid-> full re-auth.start.sh.Test plan
shellspec spec/cliproxyapi_backup_spec.sh(new case fails without the fix)shellcheckonhydrate.shFollow-up not in this PR: root-owned
0600auth files written by the container are skipped bycliproxyapi-backup-auth, so S3 can still go stale.🤖 Generated with Claude Code
Summary by cubic
Prevents Cliproxy API auth hydration from overwriting live credentials with stale S3 copies.
s3 syncran on every home-manager switch and rewrote any local auth file whose size differed, even when the local file was newer. Because S3 can lag behind the server's rotated Claude refresh tokens, a single switch reverted all Claude auths to revoked tokens and forced a full re-auth. Hydration now pulls from S3 only when the local auth cache is empty, matchingstart.sh.Written for commit 2fca61f. Summary will update on new commits.