feat: enhance workspace management and history tracking in application state
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user