style: format seluruh workspace dengan cargo fmt

Menyeragamkan format kode sesuai rustfmt (126 file). Sebelumnya
lefthook pre-commit 'cargo fmt --check' akan gagal pada commit apa pun.
This commit is contained in:
asepharyana
2026-08-27 22:10:28 +07:00
parent 884b19ccb5
commit 7b0b53671f
127 changed files with 1271 additions and 1156 deletions
@@ -160,7 +160,8 @@ pub fn spawn_background_review(
SEVERITY: HIGH|MEDIUM|LOW\n\
OLD: <exact text to replace>\n\
NEW: <replacement text>\n\
---".to_string(),
---"
.to_string(),
);
let user_msg = ChatMessage::user(format!(
@@ -210,7 +211,11 @@ pub fn spawn_background_review(
&turn_events,
TurnEvent::SystemNote {
kind: "review_finding".into(),
message: format!("📋 Auto-review complete ({} fix(es) applied).\n{}", fix_count, response_text.trim()),
message: format!(
"📋 Auto-review complete ({} fix(es) applied).\n{}",
fix_count,
response_text.trim()
),
},
);
info!(fix_count, "auto-review: completed with fixes");
@@ -237,11 +242,7 @@ async fn run_llm_review(client: &LlmClient, messages: &[ChatMessage]) -> Result<
}
/// Parse the LLM response for structured fix commands and apply them.
fn apply_fixes_from_response(
response: &str,
tools: &[Box<dyn Tool>],
tool_ctx: &ToolCtx,
) -> usize {
fn apply_fixes_from_response(response: &str, tools: &[Box<dyn Tool>], tool_ctx: &ToolCtx) -> usize {
let mut fix_count = 0;
// Parse structured fix blocks
+12 -14
View File
@@ -98,10 +98,7 @@ pub async fn run_agent(
// If no tool calls, we're done — return content
if tool_calls.is_empty() {
info!("Subagent completed after {iteration} iterations");
report_progress(
&tool_ctx,
AgentProgress::completed("subagent", directive),
);
report_progress(&tool_ctx, AgentProgress::completed("subagent", directive));
return Ok(content);
}
@@ -121,15 +118,14 @@ pub async fn run_agent(
),
);
let result =
if let Some(tool) = tools.iter().find(|t| t.name() == tool_name) {
match tool.run(&tool_ctx, &args) {
Ok(output) => output,
Err(e) => format!("Error: {e}"),
}
} else {
format!("Unknown tool: {tool_name}")
};
let result = if let Some(tool) = tools.iter().find(|t| t.name() == tool_name) {
match tool.run(&tool_ctx, &args) {
Ok(output) => output,
Err(e) => format!("Error: {e}"),
}
} else {
format!("Unknown tool: {tool_name}")
};
messages.push(ChatMessage::tool(tc.id.clone(), result));
}
@@ -149,5 +145,7 @@ pub async fn run_agent(
format!("iteration limit ({MAX_ITERATIONS})"),
),
);
Ok(format!("Subagent reached iteration limit ({MAX_ITERATIONS})"))
Ok(format!(
"Subagent reached iteration limit ({MAX_ITERATIONS})"
))
}
+1 -3
View File
@@ -40,9 +40,7 @@ impl SubagentProvider {
messages: &[ChatMessage],
) -> Result<(ChatMessage, Option<(u64, u64)>)> {
use zesdex_application::ports::ProviderService;
self.client
.chat(messages, None, Some(4096), None)
.await
self.client.chat(messages, None, Some(4096), None).await
}
/// Send messages with available tool definitions.