Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/jcode-base/src/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ impl MultiProvider {
};
provider.set_model(model)?;
registry.set_active_compatible_profile(profile_id);
self.set_active_provider(ActiveProvider::OpenRouter);
// NOTE: Do NOT call set_active_provider(ActiveProvider::OpenRouter) here
// because it clears the active compatible profile we just set above.
// The compatible profile mechanism handles routing independently.
Ok(())
Comment on lines +702 to 705
}

Expand Down
11 changes: 11 additions & 0 deletions crates/jcode-base/src/provider/openrouter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,17 @@ impl OpenRouterProvider {
pub(crate) fn load_usable_model_disk_cache_entry(
&self,
) -> Option<jcode_provider_openrouter::DiskCache> {
// For direct OpenAI-compatible profiles (e.g. DeepSeek), try the
// profile-specific namespace first so we don't fall through to a
// blocking fetch_models_from_api call every time.
if let Some(profile_id) = self.profile_id.as_deref() {
if let Some(entry) =
jcode_provider_openrouter::load_disk_cache_entry_for_namespace(profile_id)
&& self.model_disk_cache_source_matches(&entry)
{
return Some(entry);
}
}
Comment on lines +1531 to +1538
load_disk_cache_entry().filter(|entry| self.model_disk_cache_source_matches(entry))
}

Expand Down
2 changes: 1 addition & 1 deletion crates/jcode-provider-openrouter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ pub fn parse_provider_routing_from_env() -> ProviderRouting {

pub fn is_kimi_model(model: &str) -> bool {
let lower = model.to_lowercase();
lower.contains("moonshotai/") || lower.contains("kimi-k2") || lower.contains("kimi-k2.5")
lower.contains("moonshotai/") || lower.contains("kimi-k2") || lower.contains("kimi-k2.5") || lower.contains("kimi-for-coding")
Comment on lines 716 to +717
}

pub fn rank_providers_from_endpoints(endpoints: &[EndpointInfo]) -> Vec<String> {
Expand Down