Skip to content

Remove custom models options from cloud runs#11219

Merged
dagmfactory merged 3 commits into
masterfrom
dagm/remove-custom-models-from-cloud-runs
May 20, 2026
Merged

Remove custom models options from cloud runs#11219
dagmfactory merged 3 commits into
masterfrom
dagm/remove-custom-models-from-cloud-runs

Conversation

@dagmfactory
Copy link
Copy Markdown
Contributor

@dagmfactory dagmfactory commented May 18, 2026

This change removes the ability to select custom models when running cloud runs via cloud run on terminal or via orchestrate.
Custom endpoints remain available for non-cloud agent conversations and local orchestration agents.

https://www.loom.com/share/2e2fa19213b9430fa7fbae763203b5c3

@cla-bot cla-bot Bot added the cla-signed label May 18, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 18, 2026

@dagmfactory

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@dagmfactory dagmfactory changed the title Remove API key commands and related dependencies Remove custom models options from cloud runs May 18, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR removes custom endpoint models from cloud-run model selection surfaces and adds a helper for identifying custom endpoint LLM entries.

Concerns

  • For this user-facing model picker change, please include screenshots or a screen recording demonstrating the updated selector behavior end to end.
  • The new custom-endpoint helper relies on a display-description prefix, which is brittle; see the inline suggestion.

Verdict

Found: 0 critical, 1 important, 1 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/ai/llms.rs Outdated
pub fn is_custom_endpoint(&self) -> bool {
self.description
.as_ref()
.is_some_and(|d| d.starts_with("Custom · "))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 [SUGGESTION] This makes custom-endpoint detection depend on a user-facing description prefix. Prefer filtering via LLMPreferences::custom_llm_info_for_id(&llm.id).is_some() at the call sites so copy changes or a server model with the same prefix cannot change cloud model eligibility.

@dagmfactory dagmfactory requested a review from danielpeng2 May 18, 2026 18:30
@dagmfactory dagmfactory enabled auto-merge (squash) May 18, 2026 22:34
Comment on lines +461 to +474
let all_choices: Vec<_> = llm_prefs
.get_base_llm_choices_for_agent_mode(ctx_dropdown)
.filter(|llm| is_local || llm_prefs.custom_llm_info_for_id(&llm.id).is_none())
.collect();
let (auto_models, rest): (Vec<_>, Vec<_>) = all_choices
.into_iter()
.partition(|llm| llm.id.as_str().starts_with("auto"));
let (custom_models, other_models): (Vec<_>, Vec<_>) = rest
.into_iter()
.partition(|llm| llm_prefs.custom_llm_info_for_id(&llm.id).is_some());
let choices: Vec<_> = auto_models
.into_iter()
.chain(custom_models)
.chain(other_models)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The logic here might be clearer if we do something like this to exclude custom models. I think it's a little confusing to filter out the custom models at the all_choices level but still include custom_models in the chain.

let mut choices: Vec<_> = auto_models.into_iter();
if is_local {
  choices = choices.chain(custom_models);
}
choices = choices.chain(other_models);

let all_choices: Vec<_> = llm_prefs
.get_base_llm_choices_for_agent_mode(ctx_dropdown)
.filter(|llm| is_local || llm_prefs.custom_llm_info_for_id(&llm.id).is_none())
.collect();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to collect into a Vec here? That's a memory allocation that I don't think we need here, since the only time we use all_choices we immediately transform it back into an iterator using into_iter().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nope, not needed.
removed

Comment on lines +563 to +565
llm_prefs
.get_base_llm_choices_for_agent_mode(ctx)
.filter(|llm| is_local || llm_prefs.custom_llm_info_for_id(&llm.id).is_none())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the logic here rely on having the same model list as populate_model_picker_for_harness? We might want to extract the logic into a common method to avoid drift.

I wonder if we should include a include_custom_model or is_local parameter on get_base_llm_choices_for_agent_mode so that callers are forced to make a decision on whether or not they want custom models.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, added a common helper

let mut auto_choices = Vec::new();
let mut custom_choices = Vec::new();
let mut other_choices = Vec::new();
for llm in llm_preferences.get_base_llm_choices_for_agent_mode(ctx) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we use the common get_base_model_choices method here as well?

@dagmfactory dagmfactory merged commit 2ba4b64 into master May 20, 2026
41 of 43 checks passed
@dagmfactory dagmfactory deleted the dagm/remove-custom-models-from-cloud-runs branch May 20, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants