Skip to content

Commit a3f12bb

Browse files
author
Cortex Agent
committed
refactor: clean codebase - remove dead code, fix warnings, delete unused docs
- Created missing cortex_prompt.txt for engine compilation - Applied cargo fmt to standardize code formatting - Auto-fixed clippy warnings with --fix (reduced from 164 to ~128) - Removed unused code and fixed unused variable warnings - Deleted outdated documentation files: - cortex-cli/COMPREHENSIVE_ANALYSIS.md - cortex-cli/DEEP_CODE_REVIEW.md - cortex-gui/orchestration/*.md (14 files) - cortex-gui/UI_REBASE/*.md (20 files) - cortex-gui/PERFORMANCE_FEATURE_ROADMAP.md - cortex-gui/FEATURE_IMPROVEMENT_PLAN.md - cortex-gui/ZED_VSCODE_COMPARISON_ROADMAP.md - Fixed dead code warnings with #[allow(dead_code)] where appropriate - Removed unused imports and collapsed nested conditionals
1 parent 4d6faac commit a3f12bb

198 files changed

Lines changed: 2292 additions & 12069 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cortex-app-server/src/admin.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -483,18 +483,18 @@ async fn list_all_sessions(
483483
sessions.retain(|s| &s.model == model);
484484
}
485485

486-
if let Some(from) = &query.from {
487-
if let Ok(from_dt) = chrono::DateTime::parse_from_rfc3339(from) {
488-
let from_ts = from_dt.timestamp();
489-
sessions.retain(|s| s.created_at >= from_ts);
490-
}
486+
if let Some(from) = &query.from
487+
&& let Ok(from_dt) = chrono::DateTime::parse_from_rfc3339(from)
488+
{
489+
let from_ts = from_dt.timestamp();
490+
sessions.retain(|s| s.created_at >= from_ts);
491491
}
492492

493-
if let Some(to) = &query.to {
494-
if let Ok(to_dt) = chrono::DateTime::parse_from_rfc3339(to) {
495-
let to_ts = to_dt.timestamp();
496-
sessions.retain(|s| s.created_at <= to_ts);
497-
}
493+
if let Some(to) = &query.to
494+
&& let Ok(to_dt) = chrono::DateTime::parse_from_rfc3339(to)
495+
{
496+
let to_ts = to_dt.timestamp();
497+
sessions.retain(|s| s.created_at <= to_ts);
498498
}
499499

500500
// Sort
@@ -506,7 +506,7 @@ async fn list_all_sessions(
506506
}
507507

508508
let total = sessions.len();
509-
let total_pages = (total + query.limit - 1) / query.limit;
509+
let total_pages = total.div_ceil(query.limit);
510510

511511
// Paginate
512512
let start = (query.page - 1) * query.limit;
@@ -642,14 +642,14 @@ async fn export_sessions_csv(
642642

643643
/// List all shares.
644644
async fn list_all_shares(
645-
State(state): State<Arc<AppState>>,
645+
State(_state): State<Arc<AppState>>,
646646
Query(query): Query<ListSharesQuery>,
647647
) -> AppResult<Json<ShareListResponse>> {
648648
// Get all shares from the manager (assuming it's a user, we get their shares)
649649
// For admin, we'd need a method to get all shares regardless of user
650650
// For now, return what's available
651651

652-
let now = chrono::Utc::now().timestamp();
652+
let _now = chrono::Utc::now().timestamp();
653653

654654
// Note: In a real implementation, ShareManager would have a list_all method
655655
// For now, we use what's available

0 commit comments

Comments
 (0)