-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cache cloud requirements #11305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache cloud requirements #11305
Conversation
d8fe534 to
c53815f
Compare
c53815f to
10227ae
Compare
| enum CacheLoadStatus { | ||
| #[error("Skipping cloud requirements cache read because auth identity is incomplete")] | ||
| AuthIdentityIncomplete, | ||
| #[error("cloud requirements cache file not found")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: first word is not capitalized in some errors and is in other error strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| let account_id = account_id.as_deref(); | ||
|
|
||
| self.fetch_with_retries(&auth).await | ||
| match self.load_cache(chatgpt_user_id, account_id).await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If load_cache fails, do we fallback to network fetch (with the regular retries treatment)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we fall back (line 273)
10227ae to
1d3cb36
Compare
1d3cb36 to
b8c577e
Compare
We're loading these from the web on every startup. This puts them in a local file with a 1hr TTL.
We sign the downloaded requirements with a key compiled into the Codex CLI to prevent unsophisticated tampering (determined circumvention is outside of our threat model: after all, one could just compile Codex without any of these checks).
If any of the following are true, we ignore the local cache and re-fetch from Cloud: