Repository navigation
Refresh on models etag mismatch - #8491
Conversation
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex fix this |
| let _ = tx_event.send(Ok(ResponseEvent::RateLimits(snapshot))).await; | ||
| } | ||
| if let Some(etag) = models_etag { | ||
| let _ = tx_event.send(Ok(ResponseEvent::ModelsEtag(etag))).await; |
There was a problem hiding this comment.
bit annoying to have to push everything through events but that's how it is.
| } | ||
|
|
||
| async fn get_etag(&self) -> Option<String> { | ||
| self.etag.read().await.clone() |
There was a problem hiding this comment.
It's not great that etag and models are not updated atomically.
There was a problem hiding this comment.
Only one method updates them though
There was a problem hiding this comment.
yes, but one value can be updated while the other isn't
There was a problem hiding this comment.
ok will see what I can change
| .url | ||
| .query_pairs() | ||
| .any(|(k, _)| k == "client_version"), | ||
| "expected /models refresh to include client_version query param" |
There was a problem hiding this comment.
Reminder to decide on how we are sending client_version consistently across endpoints.
|
Summary
Testing
|
ModelsManagertoModelFamilyso we don't mutate it mid-turn