mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-07 17:09:13 -10:00
Fix the clippy lints the rename exposed so the hosted Lint job can pass
With the should_implement_trait error gone, clippy reached the dependents and
reported six more under CI's flags. One was mine: 7d84d0be6b removed the setter
that followed an early `return;` in apply_engine_error_to_app, which left that
`return;` as the last statement.
- tui/ui/apply.rs: drop the unneeded trailing `return;` (the code after it is
now only comments, so behaviour is unchanged).
- tui/ui/frame.rs: pass `config` instead of `&config` to
AutoReviewPolicy::from_config and UserInputLimits::from_config (needless borrow).
- tui/ui/handlers.rs: trim_start_matches/replace take a char array instead of a
matches! closure.
- tui/work_surface/terminal.rs: sort_by_key with Reverse(finished_at).
- cli/cloud/computer.rs: collapse two nested `if`s into let-chains (introduced with
the cloud key handoff work).
No behaviour changes.
Verified: workspace clippy with the exact CI flags exits 0 (first pass listed
exactly these; the final run has no diagnostics); rustfmt clean; 2082 tests
passed in the shared frozen batch including frame 98, handlers 5, work_surface
164 and cli computer 4 matching tests.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
acd520cb99
commit
65ef1ea70b
5 files changed
+14
-16
No files matched your search
@@ -314,15 +314,14 @@ pub(super) fn run<T: CloudTransport, W: Write>(
|
||||
} else {
|
||||
Value::Null
|
||||
};
|
||||
if let Some(id) = &options.thread {
|
||||
if thread["id"].as_str() != Some(id)
|
||||
if let Some(id) = &options.thread
|
||||
&& (thread["id"].as_str() != Some(id)
|
||||
|| thread["userId"].as_str() != Some(&account.account)
|
||||
|| thread["archivedAt"]
|
||||
.as_str()
|
||||
.is_some_and(|value| !value.is_empty())
|
||||
{
|
||||
bail!("This account conversation is unavailable.");
|
||||
}
|
||||
.is_some_and(|value| !value.is_empty()))
|
||||
{
|
||||
bail!("This account conversation is unavailable.");
|
||||
}
|
||||
let whale_id = options.whale.clone().or_else(|| {
|
||||
thread["agentId"]
|
||||
@@ -643,10 +642,10 @@ pub(super) fn run<T: CloudTransport, W: Write>(
|
||||
} else {
|
||||
detail
|
||||
};
|
||||
if let Some(turn) = result.get("turn") {
|
||||
if turn["thread_id"].as_str() != Some(&runtime) {
|
||||
bail!("The computer returned a different task");
|
||||
}
|
||||
if let Some(turn) = result.get("turn")
|
||||
&& turn["thread_id"].as_str() != Some(&runtime)
|
||||
{
|
||||
bail!("The computer returned a different task");
|
||||
}
|
||||
if options.json {
|
||||
writeln!(
|
||||
|
||||
@@ -319,7 +319,6 @@ pub(crate) fn apply_engine_error_to_app(
|
||||
StatusToastLevel::Warning,
|
||||
Some(8_000),
|
||||
);
|
||||
return;
|
||||
}
|
||||
// Error is already in the transcript as HistoryCell::Error above;
|
||||
// don't emit a redundant status_message that would become a sticky
|
||||
|
||||
@@ -980,7 +980,7 @@ pub(crate) fn build_engine_config(app: &App, config: &Config) -> EngineConfig {
|
||||
.is_some_and(|identity| config.subagents_enabled_for_provider(identity)),
|
||||
features: config.features(),
|
||||
auto_review_policy: crate::core::authority::auto_review::AutoReviewPolicy::from_config(
|
||||
&config,
|
||||
config,
|
||||
),
|
||||
compaction: app.compaction_config(),
|
||||
todos: app.todos.clone(),
|
||||
@@ -1069,7 +1069,7 @@ pub(crate) fn build_engine_config(app: &App, config: &Config) -> EngineConfig {
|
||||
search_base_url: config.search.as_ref().and_then(|s| s.base_url.clone()),
|
||||
search_native: config.search_native(),
|
||||
tools_always_load: config.tools_always_load(),
|
||||
user_input_limits: crate::tools::user_input::UserInputLimits::from_config(&config),
|
||||
user_input_limits: crate::tools::user_input::UserInputLimits::from_config(config),
|
||||
user_input_timeout: config.user_input_timeout(),
|
||||
goal_max_steps: Some(config.goal_max_steps()),
|
||||
tools: config.tools.clone(),
|
||||
|
||||
@@ -1572,8 +1572,8 @@ fn plan_handoff_seed_title(plan: &crate::tui::plan_handoff::PendingPlanHandoff)
|
||||
.map(|line| {
|
||||
collapse(
|
||||
&line
|
||||
.trim_start_matches(|ch: char| matches!(ch, '-' | '*' | '+' | '>'))
|
||||
.replace(|ch: char| matches!(ch, '*' | '`'), ""),
|
||||
.trim_start_matches(['-', '*', '+', '>'])
|
||||
.replace(['*', '`'], ""),
|
||||
)
|
||||
})
|
||||
.find(|line| !line.is_empty())
|
||||
|
||||
@@ -234,7 +234,7 @@ fn dock_commands(
|
||||
let (mut running, mut finished): (Vec<_>, Vec<_>) = jobs
|
||||
.into_iter()
|
||||
.partition(|job| job.status == ShellStatus::Running);
|
||||
finished.sort_by(|a, b| b.finished_at.cmp(&a.finished_at));
|
||||
finished.sort_by_key(|job| std::cmp::Reverse(job.finished_at));
|
||||
finished.truncate(FINISHED_COMMAND_TABS);
|
||||
running.extend(finished);
|
||||
running
|
||||
|
||||
Reference in new issue
Block a user