Skip to content
Merged
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
3 changes: 2 additions & 1 deletion crates/jcode-tui/src/tui/app/inline_interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4120,9 +4120,10 @@ mod tests {
assert!(route_supports_reasoning_effort("openai-oauth"));
assert!(route_supports_reasoning_effort("openai-api-key"));
assert!(route_supports_reasoning_effort("openrouter"));
assert!(route_supports_reasoning_effort(
assert!(!route_supports_reasoning_effort(
"openai-compatible:llamacpp"
));
assert!(!route_supports_reasoning_effort("openai-compatible:zai"));
assert!(!route_supports_reasoning_effort("copilot"));
assert!(!route_supports_reasoning_effort("bedrock"));
assert!(!route_supports_reasoning_effort("https"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ pub(super) fn route_supports_reasoning_effort(api_method: &str) -> bool {
| Method::OpenAIOAuth
| Method::OpenAIApiKey
| Method::OpenRouter => true,
Method::OpenAiCompatible { profile_id } => profile_id.is_some(),
// Named OpenAI-compatible profiles expose effort through `/effort`.
// Expanding them here creates one duplicate picker row per effort.
Method::OpenAiCompatible { .. } => false,
Method::JcodeSubscription
| Method::Copilot
| Method::Cursor
Expand Down
20 changes: 18 additions & 2 deletions crates/jcode-tui/src/tui/info_widget_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ fn append_model_runtime_metadata(spans: &mut Vec<Span<'static>>, data: &InfoWidg
));
}

if let Some(tier) = data.service_tier.as_deref().and_then(short_service_tier) {
let is_openai = data
.provider_name
.as_deref()
.is_some_and(|provider| provider.trim().to_ascii_lowercase().starts_with("openai"));
if is_openai && let Some(tier) = data.service_tier.as_deref().and_then(short_service_tier) {
Comment on lines +337 to +341

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Generic compatible badge leaks
starts_with("openai") still treats the generic OpenAI-compatible runtime label as OpenAI. runtime_display_name() returns exactly OpenAI-compatible for custom compatible endpoints, so those non-OpenAI providers continue to show [fast] whenever service_tier is priority.

Context Used: AGENTS.md (source)

Artifacts

Repro: generated Rust regression test patch for OpenAI-compatible provider badge rendering

  • Evidence file captured while the check ran.

Repro: verbose cargo test output showing OpenAI-compatible renders [fast] and fails the regression assertion

  • The full command output behind this check.

Repro: exact cargo test command used for the narrow badge leak check

  • Evidence file captured while the check ran.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-tui/src/tui/info_widget_model.rs
Line: 337-341

Comment:
**Generic compatible badge leaks**
`starts_with("openai")` still treats the generic `OpenAI-compatible` runtime label as OpenAI. `runtime_display_name()` returns exactly `OpenAI-compatible` for custom compatible endpoints, so those non-OpenAI providers continue to show `[fast]` whenever `service_tier` is `priority`.

**Context Used:** AGENTS.md ([source](https://app.greptile.com/solo-systems/github/1jehuang/jcode/-/custom-context?memory=04aa75db-3e8e-4529-8341-c7b9dc373978))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

spans.push(Span::styled(" ", Style::default()));
spans.push(Span::styled(
format!("[{tier}]"),
Expand Down Expand Up @@ -436,7 +440,8 @@ mod tests {
#[test]
fn model_widget_and_overview_show_same_runtime_metadata() {
let rect = Rect::new(0, 0, 40, 8);
let data = data();
let mut data = data();
data.provider_name = Some("openai".to_string());

let independent = first_line_text(render_model_widget(&data, rect));
let overview = first_line_text(render_model_info(&data, rect));
Expand All @@ -446,4 +451,15 @@ mod tests {
assert!(overview.contains("(hi)"));
assert!(overview.contains("[fast]"));
}

#[test]
fn non_openai_provider_hides_openai_service_tier() {
let rect = Rect::new(0, 0, 40, 8);
let mut data = data();
data.model = Some("deepseek-v4-flash".to_string());
data.provider_name = Some("deepseek".to_string());

assert!(!first_line_text(render_model_widget(&data, rect)).contains("[fast]"));
assert!(!first_line_text(render_model_info(&data, rect)).contains("[fast]"));
}
}
Loading