diff options
| author | soryu <soryu@soryu.co> | 2026-04-28 00:55:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-28 00:55:25 +0100 |
| commit | 5aa3fafb4acfa89c7d04e84abf7861607733e8ce (patch) | |
| tree | 8a444bcc3b595c5655b71e76a70e7b47936225f8 /makima/src | |
| parent | d6f01a69f61a40843054f27b427687e1fa1cedfb (diff) | |
| download | soryu-5aa3fafb4acfa89c7d04e84abf7861607733e8ce.tar.gz soryu-5aa3fafb4acfa89c7d04e84abf7861607733e8ce.zip | |
fix: resolve compilation error and warnings in Rust backend (#95)
* fix: resolve compilation error and warnings in Rust backend
- Fix syntax error in directive.rs phase_replanning (bad merge created
duplicate code blocks with broken `.await {` syntax)
- Remove unused imports: WorktreeError, DaemonReauthStatus, ratatui::prelude
- Prefix unused variables with underscore: claude_command, content, owner_id
- Suppress unused_assignments warning on final_exit_code
- Add #[allow(unused_imports)] for cfg(unix) CommandExt imports
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: heartbeat checkpoint
* fix: suppress remaining compiler warnings for clean build
- Add #[allow(dead_code)] for unused but intentionally kept functions
- Remove useless self-assignments in listen handler
- Fixes: truncate_string, checkout_commit, handle_get_worktree_diff,
default_max_retries, STREAM_CHUNK_MS, listen(), MessageResponse.role
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'makima/src')
| -rw-r--r-- | makima/src/daemon/process/claude.rs | 2 | ||||
| -rw-r--r-- | makima/src/daemon/storage/patch.rs | 1 | ||||
| -rw-r--r-- | makima/src/daemon/task/manager.rs | 6 | ||||
| -rw-r--r-- | makima/src/daemon/tui/mod.rs | 1 | ||||
| -rw-r--r-- | makima/src/db/models.rs | 1 | ||||
| -rw-r--r-- | makima/src/db/repository.rs | 1 | ||||
| -rw-r--r-- | makima/src/listen.rs | 2 | ||||
| -rw-r--r-- | makima/src/llm/groq.rs | 1 | ||||
| -rw-r--r-- | makima/src/orchestration/directive.rs | 77 | ||||
| -rw-r--r-- | makima/src/server/handlers/listen.rs | 3 | ||||
| -rw-r--r-- | makima/src/server/handlers/mesh.rs | 2 | ||||
| -rw-r--r-- | makima/src/server/handlers/mesh_daemon.rs | 2 | ||||
| -rw-r--r-- | makima/src/server/handlers/mesh_supervisor.rs | 2 |
13 files changed, 39 insertions, 62 deletions
diff --git a/makima/src/daemon/process/claude.rs b/makima/src/daemon/process/claude.rs index 57c8f77..aa18fab 100644 --- a/makima/src/daemon/process/claude.rs +++ b/makima/src/daemon/process/claude.rs @@ -577,6 +577,7 @@ impl ProcessManager { // On Unix, create a new process group so we can kill all child processes #[cfg(unix)] { + #[allow(unused_imports)] use std::os::unix::process::CommandExt; cmd.process_group(0); } @@ -762,6 +763,7 @@ impl ProcessManager { // On Unix, create a new process group so we can kill all child processes #[cfg(unix)] { + #[allow(unused_imports)] use std::os::unix::process::CommandExt; cmd.process_group(0); } diff --git a/makima/src/daemon/storage/patch.rs b/makima/src/daemon/storage/patch.rs index 05c45a3..c9bc6f5 100644 --- a/makima/src/daemon/storage/patch.rs +++ b/makima/src/daemon/storage/patch.rs @@ -387,6 +387,7 @@ fn parse_diff_stat(stat_output: &str) -> (usize, usize) { } /// Checkout a specific commit in the worktree. +#[allow(dead_code)] pub async fn checkout_commit(worktree_path: &Path, sha: &str) -> Result<(), PatchError> { let output = Command::new("git") .current_dir(worktree_path) diff --git a/makima/src/daemon/task/manager.rs b/makima/src/daemon/task/manager.rs index ca97453..f483218 100644 --- a/makima/src/daemon/task/manager.rs +++ b/makima/src/daemon/task/manager.rs @@ -20,7 +20,7 @@ use crate::daemon::error::{DaemonError, TaskError, TaskResult}; use crate::daemon::process::{ClaudeInputMessage, ProcessManager}; use crate::daemon::storage; use crate::daemon::temp::TempManager; -use crate::daemon::worktree::{is_new_repo_request, ConflictResolution, WorktreeError, WorktreeInfo, WorktreeManager}; +use crate::daemon::worktree::{is_new_repo_request, ConflictResolution, WorktreeInfo, WorktreeManager}; use crate::daemon::db::local::LocalDb; use crate::daemon::ws::{BranchInfo, DaemonCommand, DaemonMessage}; @@ -3706,6 +3706,7 @@ impl TaskManager { } /// Handle GetWorktreeDiff command - get git diff for a task's worktree. + #[allow(dead_code)] async fn handle_get_worktree_diff( &self, task_id: Uuid, @@ -5622,7 +5623,7 @@ impl TaskManagerInner { let ws_tx = self.ws_tx.clone(); // For auth error detection - let claude_command = self.process_manager.claude_command().to_string(); + let _claude_command = self.process_manager.claude_command().to_string(); let daemon_hostname = hostname::get().ok().and_then(|h| h.into_string().ok()); let mut auth_error_handled = false; @@ -5630,6 +5631,7 @@ impl TaskManagerInner { let mut accumulated_output = String::new(); let mut circuit_breaker = CircuitBreaker::new(); let mut iteration_count = 0u32; + #[allow(unused_assignments)] let mut final_exit_code: i64 = -1; // Track the final exit code across iterations // Autonomous loop: we may run multiple iterations diff --git a/makima/src/daemon/tui/mod.rs b/makima/src/daemon/tui/mod.rs index e52b12a..46652ec 100644 --- a/makima/src/daemon/tui/mod.rs +++ b/makima/src/daemon/tui/mod.rs @@ -26,7 +26,6 @@ use crossterm::{ execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; -use ratatui::prelude::*; use ratatui::backend::CrosstermBackend; pub type Terminal = ratatui::Terminal<CrosstermBackend<io::Stdout>>; diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index c03b4ac..121897d 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -7,6 +7,7 @@ use utoipa::ToSchema; use uuid::Uuid; /// Default max retries for task daemon failover (3 attempts) +#[allow(dead_code)] fn default_max_retries() -> i32 { 3 } diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs index 401da94..10633d5 100644 --- a/makima/src/db/repository.rs +++ b/makima/src/db/repository.rs @@ -4912,6 +4912,7 @@ pub async fn sync_supervisor_state( // ============================================================================= /// Helper to truncate string to max length +#[allow(dead_code)] fn truncate_string(s: &str, max_len: usize) -> String { if s.len() <= max_len { s.to_string() diff --git a/makima/src/listen.rs b/makima/src/listen.rs index 91d616c..6391453 100644 --- a/makima/src/listen.rs +++ b/makima/src/listen.rs @@ -6,6 +6,7 @@ pub use parakeet_rs::{ParakeetEOU, ParakeetTDT, TimedToken, TimestampMode}; use crate::audio; +#[allow(dead_code)] const STREAM_CHUNK_MS: u32 = 5_000; /// A segment of dialogue with speaker identification and timing. @@ -17,6 +18,7 @@ pub struct DialogueSegment { pub text: String, } +#[allow(dead_code)] pub(crate) fn listen() -> Result<Vec<DialogueSegment>, Box<dyn std::error::Error>> { let audio_path = Path::new("audio-ftc.mp3"); diff --git a/makima/src/llm/groq.rs b/makima/src/llm/groq.rs index ee01fcf..8da9746 100644 --- a/makima/src/llm/groq.rs +++ b/makima/src/llm/groq.rs @@ -83,6 +83,7 @@ struct Choice { #[derive(Debug, Deserialize)] struct MessageResponse { + #[allow(dead_code)] role: String, content: Option<String>, tool_calls: Option<Vec<ToolCallResponse>>, diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs index 19077c9..b9ff3fe 100644 --- a/makima/src/orchestration/directive.rs +++ b/makima/src/orchestration/directive.rs @@ -448,6 +448,27 @@ impl DirectiveOrchestrator { "Directive goal updated — spawning re-planning task" ); + // If directive already has a PR, remove completed steps that were included in it + if directive.pr_url.is_some() || directive.pr_branch.is_some() { + match remove_already_merged_steps(&self.pool, directive.id).await { + Ok(count) if count > 0 => { + tracing::info!( + directive_id = %directive.id, + removed = count, + "Auto-removed completed steps already included in PR before replanning" + ); + } + Err(e) => { + tracing::warn!( + directive_id = %directive.id, + error = %e, + "Failed to auto-remove merged steps before replanning" + ); + } + _ => {} + } + } + let existing_steps = repository::list_directive_steps(&self.pool, directive.id).await?; let generation = @@ -471,61 +492,9 @@ impl DirectiveOrchestrator { { tracing::warn!( directive_id = %directive.id, - title = %directive.title, - "Directive goal updated — spawning re-planning task" + error = %e, + "Failed to spawn re-planning task" ); - - // If directive already has a PR, remove completed steps that were included in it - if directive.pr_url.is_some() || directive.pr_branch.is_some() { - match remove_already_merged_steps(&self.pool, directive.id).await { - Ok(count) if count > 0 => { - tracing::info!( - directive_id = %directive.id, - removed = count, - "Auto-removed completed steps already included in PR before replanning" - ); - } - Err(e) => { - tracing::warn!( - directive_id = %directive.id, - error = %e, - "Failed to auto-remove merged steps before replanning" - ); - } - _ => {} - } - } - - let existing_steps = - repository::list_directive_steps(&self.pool, directive.id).await?; - let generation = - repository::get_directive_max_generation(&self.pool, directive.id).await? + 1; - let goal_history = - repository::get_directive_goal_history(&self.pool, directive.id, 3).await?; - - let plan = - build_planning_prompt(&directive, &existing_steps, generation, &goal_history); - - if let Err(e) = self - .spawn_orchestrator_task( - directive.id, - directive.owner_id, - format!("Re-plan: {}", directive.title), - plan, - directive.repository_url.as_deref(), - directive.base_branch.as_deref(), - ) - .await - { - tracing::warn!( - directive_id = %directive.id, - error = %e, - "Failed to spawn re-planning task" - ); - } - Ok::<(), anyhow::Error>(()) - }.await { - tracing::warn!(directive_id = %directive.id, error = %e, "Error in re-planning directive — continuing"); } } Ok(()) diff --git a/makima/src/server/handlers/listen.rs b/makima/src/server/handlers/listen.rs index e1bc30e..7edcdfc 100644 --- a/makima/src/server/handlers/listen.rs +++ b/makima/src/server/handlers/listen.rs @@ -208,8 +208,7 @@ async fn handle_socket(socket: WebSocket, state: SharedState) { audio_offset = 0.0; finalized_segments.clear(); file_id = None; - authenticated_owner_id = authenticated_owner_id; // Keep from above - target_contract_id = target_contract_id; // Keep from above + // authenticated_owner_id and target_contract_id are kept from above // Reset models for new session let mut sortformer = ml_models.sortformer.lock().await; diff --git a/makima/src/server/handlers/mesh.rs b/makima/src/server/handlers/mesh.rs index 1a5b9c1..d9d40d7 100644 --- a/makima/src/server/handlers/mesh.rs +++ b/makima/src/server/handlers/mesh.rs @@ -20,7 +20,7 @@ use crate::db::models::{ use crate::db::repository::{self, RepositoryError}; use crate::server::auth::Authenticated; use crate::server::messages::ApiError; -use crate::server::state::{DaemonCommand, DaemonReauthStatus, SharedState, TaskUpdateNotification}; +use crate::server::state::{DaemonCommand, SharedState, TaskUpdateNotification}; // ============================================================================= // Authentication Types diff --git a/makima/src/server/handlers/mesh_daemon.rs b/makima/src/server/handlers/mesh_daemon.rs index e5f0a81..ed1b603 100644 --- a/makima/src/server/handlers/mesh_daemon.rs +++ b/makima/src/server/handlers/mesh_daemon.rs @@ -1627,7 +1627,7 @@ async fn handle_daemon_connection(socket: WebSocket, state: SharedState, auth_re ); // Broadcast as task output with auth_required type so UI can display the login link - let content = format!( + let _content = format!( "🔐 Authentication required on daemon{}. Click to login: {}", hostname.as_ref().map(|h| format!(" ({})", h)).unwrap_or_default(), login_url diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs index ebde52b..3adb850 100644 --- a/makima/src/server/handlers/mesh_supervisor.rs +++ b/makima/src/server/handlers/mesh_supervisor.rs @@ -1272,7 +1272,7 @@ pub async fn create_branch( headers: HeaderMap, Json(request): Json<CreateBranchRequest>, ) -> impl IntoResponse { - let (supervisor_id, owner_id) = match verify_supervisor_auth(&state, &headers, None).await { + let (supervisor_id, _owner_id) = match verify_supervisor_auth(&state, &headers, None).await { Ok(ids) => ids, Err(e) => return e.into_response(), }; |
