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/orchestration/directive.rs | |
| 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/orchestration/directive.rs')
| -rw-r--r-- | makima/src/orchestration/directive.rs | 77 |
1 files changed, 23 insertions, 54 deletions
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(()) |
