ci: fix unused import + cargo fmt drift from #27
The #27 per-mode context budget commit (1be18e69) replaced calls to
compaction_threshold_for_model with compaction_threshold_for_model_and_effort
but left the old name in the import list, which fails under -Dwarnings on
Build, Test, and the npm wrapper smoke job. Also re-runs cargo fmt over
the four files the lint job flagged.
This commit is contained in:
@@ -2895,8 +2895,8 @@ impl Engine {
|
||||
// assistant message in the conversation history. Saving a
|
||||
// placeholder here keeps the on-disk session structurally
|
||||
// correct so subsequent requests won't 400.
|
||||
let needs_thinking_block = !tool_uses.is_empty()
|
||||
|| tool_parser::has_tool_call_markers(¤t_text_raw);
|
||||
let needs_thinking_block =
|
||||
!tool_uses.is_empty() || tool_parser::has_tool_call_markers(¤t_text_raw);
|
||||
let thinking_to_persist = if !current_thinking.is_empty() {
|
||||
Some(current_thinking.clone())
|
||||
} else if needs_thinking_block {
|
||||
|
||||
@@ -297,7 +297,8 @@ pub fn compaction_threshold_for_model_and_effort(
|
||||
reasoning_effort: Option<&str>,
|
||||
) -> usize {
|
||||
let lower = model.to_lowercase();
|
||||
if !lower.contains("deepseek") || !(lower.contains("v4") || is_current_deepseek_v4_alias(&lower))
|
||||
if !lower.contains("deepseek")
|
||||
|| !(lower.contains("v4") || is_current_deepseek_v4_alias(&lower))
|
||||
{
|
||||
return compaction_threshold_for_model(model);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ use crate::config::{ApiProvider, Config, has_api_key, save_api_key};
|
||||
use crate::core::coherence::CoherenceState;
|
||||
use crate::hooks::{HookContext, HookEvent, HookExecutor, HookResult};
|
||||
use crate::models::{
|
||||
Message, SystemPrompt, compaction_message_threshold_for_model, compaction_threshold_for_model,
|
||||
Message, SystemPrompt, compaction_message_threshold_for_model,
|
||||
compaction_threshold_for_model_and_effort,
|
||||
};
|
||||
use crate::palette::{self, UiTheme};
|
||||
@@ -623,10 +623,8 @@ impl App {
|
||||
let max_input_history = settings.max_input_history;
|
||||
let ui_theme = palette::ui_theme(&settings.theme);
|
||||
let model = settings.default_model.clone().unwrap_or(model);
|
||||
let compact_threshold = compaction_threshold_for_model_and_effort(
|
||||
&model,
|
||||
config.reasoning_effort(),
|
||||
);
|
||||
let compact_threshold =
|
||||
compaction_threshold_for_model_and_effort(&model, config.reasoning_effort());
|
||||
|
||||
// Start in YOLO mode if --yolo flag was passed
|
||||
let preferred_mode = AppMode::from_setting(&settings.default_mode);
|
||||
|
||||
@@ -445,7 +445,10 @@ fn footer_auxiliary_spans_show_cache_and_cost_when_roomy() {
|
||||
let roomy = spans_text(&footer_auxiliary_spans(&app, 32));
|
||||
assert!(roomy.contains("cache 75%"));
|
||||
assert!(roomy.contains("$12.34"));
|
||||
assert!(!roomy.contains("ctx"), "context % removed from footer — shown in header only");
|
||||
assert!(
|
||||
!roomy.contains("ctx"),
|
||||
"context % removed from footer — shown in header only"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user