Gate task subagents behind permission prompt; subagents=false / --no-subagents; description: only when asked
This commit is contained in:
1 parent
161c33fe6c
commit
b84b6ab23a
6 files changed
+46
-6
No files matched your search
@@ -49,6 +49,9 @@ struct Cli {
|
||||
/// prompt (also `permissions = "auto"`).
|
||||
#[arg(long, conflicts_with = "yolo")]
|
||||
auto: bool,
|
||||
/// Do not offer the `task` subagent tool to the model.
|
||||
#[arg(long)]
|
||||
no_subagents: bool,
|
||||
/// Run bash, LSP servers and lens runners in a sandbox (bwrap / seatbelt).
|
||||
#[arg(long, conflicts_with = "no_sandbox")]
|
||||
sandbox: bool,
|
||||
@@ -160,6 +163,8 @@ struct Config {
|
||||
max_tokens: Option<u32>,
|
||||
/// Model for read-only `task` subagents; default: the provider's cheapest tier (Haiku / Luna).
|
||||
explore_model: Option<String>,
|
||||
/// Register the `task` subagent tool (default true; each call still asks the user). `--no-subagents` = off.
|
||||
subagents: Option<bool>,
|
||||
/// Add the `codemode` tool: JS scripts that call the other tools (default false).
|
||||
codemode: Option<bool>,
|
||||
/// Capture the mouse for wheel scrolling (default true; false = terminal selection works without shift).
|
||||
@@ -236,6 +241,7 @@ impl Config {
|
||||
compact_at: o.compact_at.or(c.compact_at),
|
||||
max_tokens: o.max_tokens.or(c.max_tokens),
|
||||
explore_model: o.explore_model.or(c.explore_model),
|
||||
subagents: o.subagents.or(c.subagents),
|
||||
codemode: o.codemode.or(c.codemode),
|
||||
mouse: o.mouse.or(c.mouse),
|
||||
remember_model: o.remember_model.or(c.remember_model),
|
||||
@@ -704,7 +710,9 @@ async fn main() -> Result<()> {
|
||||
];
|
||||
rows.extend(skill_rows);
|
||||
let mut specs = reg.specs();
|
||||
specs.push(hx_core::subagent::spec());
|
||||
if !cli.no_subagents && cfg.subagents != Some(false) {
|
||||
specs.push(hx_core::subagent::spec());
|
||||
}
|
||||
specs.sort_by_key(|t| {
|
||||
std::cmp::Reverse(serde_json::to_string(t).map_or(0, |s| s.len()))
|
||||
});
|
||||
@@ -1052,7 +1060,7 @@ async fn main() -> Result<()> {
|
||||
mgr.warm(probe).await;
|
||||
}
|
||||
trace("lens");
|
||||
{
|
||||
if !cli.no_subagents && cfg.subagents != Some(false) {
|
||||
// children get the parent's tools as of now (no `task`, so no recursion)
|
||||
let mut general = agent.tools.clone();
|
||||
general.retain(|n| n != "ask_user" && n != "exit_plan");
|
||||
|
||||
Reference in new issue
Block a user