feat: enhance workspace management and history tracking in application state

This commit is contained in:
asepharyana
2026-07-12 18:09:03 +07:00
parent a59feb23c4
commit 8a11a469f9
12 changed files with 112 additions and 20 deletions
+4 -2
View File
@@ -14,6 +14,7 @@ pub struct SubagentContext {
pub allowed_tools: Vec<String>,
pub max_steps: usize,
pub session_dir: PathBuf,
pub workspaces: Vec<PathBuf>,
}
/// Build a `SubagentContext` from an `AgentDefinition`.
@@ -23,8 +24,8 @@ pub struct SubagentContext {
/// fall back to an empty list (i.e. "all tools allowed") for other roles.
/// `max_steps` is read from the definition, defaulting to 25 if absent.
///
/// Return: a context with empty `system_prompt` and `session_dir`,
/// resolved `max_steps`, and the resolved allowed-tool list.
/// Return: a context with empty `system_prompt`, empty `workspaces`,
/// empty `session_dir`, resolved `max_steps`, and the resolved allowed-tool list.
pub fn build_subagent_context(def: AgentDefinition) -> SubagentContext {
let allowed_tools = def.allowed_tools.clone().unwrap_or_else(|| {
if def.role == "reviewer" {
@@ -39,5 +40,6 @@ pub fn build_subagent_context(def: AgentDefinition) -> SubagentContext {
allowed_tools,
max_steps,
session_dir: PathBuf::new(),
workspaces: Vec::new(),
}
}