fix plan check catch-22
This commit is contained in:
@@ -207,6 +207,9 @@ pub async fn run_agent_mode(
|
||||
if flags.acd {
|
||||
agent.set_acd_enabled(true);
|
||||
}
|
||||
if flags.skip_plan_tool_check {
|
||||
agent.set_skip_plan_tool_check(true);
|
||||
}
|
||||
|
||||
// If resuming a session, restore context and TODO
|
||||
let initial_task = if let Some(ref incomplete_session) = resuming_session {
|
||||
|
||||
@@ -32,6 +32,8 @@ pub struct CommonFlags {
|
||||
pub project: Option<PathBuf>,
|
||||
/// Resume a specific session by ID
|
||||
pub resume: Option<String>,
|
||||
/// Skip the plan approval gate for plan tools
|
||||
pub skip_plan_tool_check: bool,
|
||||
}
|
||||
|
||||
#[derive(Parser, Clone)]
|
||||
@@ -161,6 +163,11 @@ pub struct Cli {
|
||||
/// Load a project from the given path at startup (like /project but without auto-prompt)
|
||||
#[arg(long, value_name = "PATH")]
|
||||
pub project: Option<PathBuf>,
|
||||
|
||||
/// Skip the plan approval gate check for plan tools (plan_read, plan_write, plan_approve).
|
||||
/// Without this flag, plan tools are subject to the same approval gate as other tools.
|
||||
#[arg(long)]
|
||||
pub skip_plan_tool_check: bool,
|
||||
}
|
||||
|
||||
impl Cli {
|
||||
@@ -179,6 +186,7 @@ impl Cli {
|
||||
acd: self.acd,
|
||||
project: self.project.clone(),
|
||||
resume: self.resume.clone(),
|
||||
skip_plan_tool_check: self.skip_plan_tool_check,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,6 +193,9 @@ async fn run_console_mode(
|
||||
if cli.acd {
|
||||
agent.set_acd_enabled(true);
|
||||
}
|
||||
if cli.skip_plan_tool_check {
|
||||
agent.set_skip_plan_tool_check(true);
|
||||
}
|
||||
|
||||
// Load CLI project if --project flag was specified
|
||||
let initial_project: Option<project::Project> = if let Some(ref project_path) = cli.project {
|
||||
|
||||
Reference in New Issue
Block a user