Repository navigation
Conversation
Cloud's system-held run refresh atomically replaces an access-only
{"token","expiresAt"} creds file inside the sandbox. The mount read that
file once at startup and only reread it after a request was rejected,
ignored the expiresAt key, and kept websockets on the dial-time bearer.
- delegatedauth/mount creds: accept expiresAt as the bearer expiry.
- HTTPClient: optional per-request token source; relayfile-mount installs
one that stats the creds file and reparses only on change, skipping
expired or unparseable content.
- Websocket: recheck the bearer every 15s and redial immediately (no
failure backoff) when it rotates.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
Relayfile Eval ReviewRun: Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesNo reviewable human-review cases captured Relayfile output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft / deploy hold. This is part of the system-held run token refresh (cloud #5161, relayauth #105, relaycast #550). It's safe for existing mounts, but hold it with the rest of that rollout.
Why
Cloud's system-held refresh worker keeps refresh tokens outside the sandbox. It pushes only access tokens, by atomically renaming an access-only
{"token","expiresAt"}file into place every refresh cycle (15-minute access tokens). Before this change,relayfile-mount:--creds-fileonce at startup and reread it only after a request got a 401;expiresAtkey, so it treated those tokens as never expiring;Changes
delegatedauth.Bundleand the mount creds struct acceptexpiresAtas the bearer expiry.mountsync.HTTPClient.SetTokenSourceFunc: an optional source consulted on everyToken()call.relayfile-mountinstalls one for--creds-file. It stats the file on each use and reparses it only when the inode, mtime or size changes. It skips expired or unparseable content, and doesn't count the file that startup already read as a change. The existing 401 refresh path is unchanged.No token values are logged.
Tests
TestInstallCredsFileRefreshUsesPushedAccessTokenOnNextRequest(the next request uses the pushed token, with no 401 round trip).TestCredsFileTokenSourceIgnoresExpiredAccessOnlyToken.TestWebSocketRedialsWithRotatedBearer(passes 5/5 with-count=5).TestBearerExpiresAtAcceptsAccessOnlyShape.go test ./internal/delegatedauth ./cmd/relayfile-mount ./internal/mountsync -count=1: all pass.go vetis clean.Not covered here
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Agent Relay sessions
claudesession79b75307· opened viagh pr create· last active 2026-10-18