From 668d7857e671e2237b137cb9f60f47176a70a23d Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 7 Apr 2026 18:01:53 -0400 Subject: [PATCH] fix(clippy): restore workspace lint cleanups after main merge Reapply the lint-safe changes that were partially displaced while merging origin/main, including the billing serialization assertion and the attach replay/server annotation cleanups. This keeps the merged main branch back to a clean full-workspace clippy pass before the store-dump debugging continues. --- lib/crates/fabro-cli/src/user_config.rs | 2 +- lib/crates/fabro-llm/src/providers/anthropic.rs | 2 +- lib/crates/fabro-model/src/billing.rs | 10 +++++++++- lib/crates/fabro-server/src/serve.rs | 2 +- lib/crates/fabro-server/src/server.rs | 6 +++--- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/crates/fabro-cli/src/user_config.rs b/lib/crates/fabro-cli/src/user_config.rs index 672f4ba11..18a2c10c8 100644 --- a/lib/crates/fabro-cli/src/user_config.rs +++ b/lib/crates/fabro-cli/src/user_config.rs @@ -5,10 +5,10 @@ pub(crate) use fabro_config::user::*; use anyhow::{Result, bail}; use fabro_config::ConfigLayer; use fabro_types::Settings; +use fabro_util::version::FABRO_VERSION; use tracing::debug; use crate::args::ServerTargetArgs; -use fabro_util::version::FABRO_VERSION; pub(crate) fn load_settings() -> anyhow::Result { load_settings_with_config_and_storage_dir(None, None) diff --git a/lib/crates/fabro-llm/src/providers/anthropic.rs b/lib/crates/fabro-llm/src/providers/anthropic.rs index c3aca00dc..94444dcad 100644 --- a/lib/crates/fabro-llm/src/providers/anthropic.rs +++ b/lib/crates/fabro-llm/src/providers/anthropic.rs @@ -162,8 +162,8 @@ struct ApiResponse { usage: ApiUsage, } -#[allow(clippy::struct_field_names)] #[derive(serde::Deserialize)] +#[allow(clippy::struct_field_names)] // Match Anthropic's API usage payload field names. struct ApiUsage { input_tokens: i64, output_tokens: i64, diff --git a/lib/crates/fabro-model/src/billing.rs b/lib/crates/fabro-model/src/billing.rs index 8470025bc..b3bbb4f31 100644 --- a/lib/crates/fabro-model/src/billing.rs +++ b/lib/crates/fabro-model/src/billing.rs @@ -247,7 +247,7 @@ pub struct ModelPricing { pub policy: ModelPricingPolicy, } -#[allow(clippy::empty_structs_with_brackets)] +#[allow(clippy::empty_structs_with_brackets)] // Serialize as `{}` rather than unit-struct `null`. #[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] pub struct OpenAiBillingFacts {} @@ -735,4 +735,12 @@ mod tests { assert_eq!(price.usd_micros, i64::MAX); } + + #[test] + fn openai_billing_facts_serialize_as_empty_object() { + assert_eq!( + serde_json::to_value(OpenAiBillingFacts::default()).unwrap(), + serde_json::json!({}) + ); + } } diff --git a/lib/crates/fabro-server/src/serve.rs b/lib/crates/fabro-server/src/serve.rs index 02a308a56..6c632eea7 100644 --- a/lib/crates/fabro-server/src/serve.rs +++ b/lib/crates/fabro-server/src/serve.rs @@ -472,7 +472,7 @@ async fn wait_for_shutdown(mut shutdown_rx: watch::Receiver) { let _ = shutdown_rx.changed().await; } -#[allow(clippy::print_stderr)] +#[allow(clippy::print_stderr)] // Startup status belongs on stderr for operator-facing CLI output. fn announce_server_ready(bind_addr: &Bind, styles: &'static Styles, dry_run_mode: bool) { set_server_title(ServerTitlePhase::Listening, Some(bind_addr)); info!(bind = %bind_addr, dry_run = dry_run_mode, "API server started"); diff --git a/lib/crates/fabro-server/src/server.rs b/lib/crates/fabro-server/src/server.rs index 7c7a1249d..e84c3a1d6 100644 --- a/lib/crates/fabro-server/src/server.rs +++ b/lib/crates/fabro-server/src/server.rs @@ -110,8 +110,6 @@ pub fn default_page_limit() -> u32 { 20 } -const ATTACH_REPLAY_BATCH_LIMIT: usize = 256; - #[derive(serde::Deserialize)] pub struct PaginationParams { #[serde(rename = "page[limit]", default = "default_page_limit")] @@ -2559,7 +2557,7 @@ fn api_question_from_interview_question(id: &str, question: &Question) -> ApiQue } } -#[allow(clippy::result_large_err)] +#[allow(clippy::result_large_err)] // Axum handlers naturally propagate full `Response` errors. fn answer_from_request(req: SubmitAnswerRequest, question: &Question) -> Result { if let Some(key) = req.selected_option_key { let option = question @@ -3645,6 +3643,8 @@ async fn attach_run_events( Path(id): Path, Query(params): Query, ) -> Response { + const ATTACH_REPLAY_BATCH_LIMIT: usize = 256; + let id = match parse_run_id_path(&id) { Ok(id) => id, Err(response) => return response,