Skip to content

hard disable remote models refresh when feature is disabled#8687

Merged
aibrahim-oai merged 3 commits intomainfrom
disable-refresh-on-feature-disabled
Jan 2, 2026
Merged

hard disable remote models refresh when feature is disabled#8687
aibrahim-oai merged 3 commits intomainfrom
disable-refresh-on-feature-disabled

Conversation

@aibrahim-oai
Copy link
Collaborator

We were refreshing on tag mismatch even with feature is disabled

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bfe34025f

ℹ️ 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".

Comment on lines 97 to 99
if !remote_models_feature && self.auth_manager.get_auth_mode() == Some(AuthMode::ApiKey) {
return Ok(());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Badge Gate refresh on RemoteModels for all auth modes

When RemoteModels is disabled (the default), refresh_if_new_etag now forwards remote_models_feature=false, but refresh_available_models_no_cache only short‑circuits when the auth mode is ApiKey. For ChatGPT auth, the guard doesn’t trigger and the code still calls list_models, so a ResponseEvent::ModelsEtag with an X-Models-Etag header will still cause a network refresh even though the feature is off. This defeats the stated goal of hard‑disabling refresh when the feature is disabled. The guard should short‑circuit on the feature flag regardless of auth mode (and still exclude ApiKey if that remains desired).

Useful? React with 👍 / 👎.

if self.auth_manager.get_auth_mode() == Some(AuthMode::ApiKey) {
pub(crate) async fn refresh_available_models_no_cache(
&self,
remote_models_feature: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this config go into model manager ctor?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the value ever change mid session?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ideally yeah but app server mutates it after construction unfortunately. Plus, we don't have access to config on construction.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you pass config into some and exact value into other refresh methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just so I don't keep propagating config everywhere. will just use exact value in all methods

@aibrahim-oai aibrahim-oai merged commit 6846bc1 into main Jan 2, 2026
26 checks passed
@aibrahim-oai aibrahim-oai deleted the disable-refresh-on-feature-disabled branch January 2, 2026 23:22
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants