refactor: improve code readability and consistency across multiple files

This commit is contained in:
asepharyana
2026-07-20 12:02:50 +07:00
parent 4ced6681c2
commit 1ec2aa136a
17 changed files with 117 additions and 41 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ const MAX_ITERATIONS: u32 = 25;
/// a. Call the LLM (non-streaming) with accumulated messages + tool defs.
/// b. If the response has no tool calls → return the text content.
/// c. Otherwise execute each tool call and append the result as a
/// tool-role message.
/// tool-role message.
/// d. If the response also contained text, append an assistant message.
/// 4. If the loop exits naturally, return the iteration-limit message.
pub async fn run_agent(
+1 -1
View File
@@ -3,7 +3,7 @@
//!
//! Flow: `resolve_subagent_provider` is called at startup to pick a provider
//! + model → `SubagentProvider` wraps that pair around an `LlmClient` for use
//! inside the subagent engine loop.
//! inside the subagent engine loop.
use anyhow::Result;
@@ -1,9 +1,9 @@
//! Subagent workspace management — create isolated workspaces for subagents.
use std::path::PathBuf;
use std::path::{Path, PathBuf};
/// Create an isolated workspace directory for a subagent.
pub fn create_subagent_workspace(base_dir: &PathBuf, agent_id: &str) -> anyhow::Result<PathBuf> {
pub fn create_subagent_workspace(base_dir: &Path, agent_id: &str) -> anyhow::Result<PathBuf> {
let ws = base_dir.join("subagent-workspaces").join(agent_id);
std::fs::create_dir_all(&ws)?;
Ok(ws)