add agent-facing compact tool gated on context usage

This commit is contained in:
damocles 2026-07-23 10:08:34 +02:00 committed by mara
commit e9df5def02
6 changed files with 133 additions and 16 deletions

View file

@ -640,7 +640,13 @@ impl ToolGroup {
/// dark on the dashboard. The server-side `SetStatus` handler has no
/// tool-group check either (only length validation), so listing it here
/// keeps the `--allowedTools` list honest with that reality.
pub const ALWAYS_ON_TOOLS: &'static [&'static str] = &["set_status"];
///
/// `compact` lives here too: it's pure self-management (no cross-agent
/// effect, no privilege), gated server-side on context usage rather
/// than on tool groups, and every agent should be able to reach for it
/// regardless of which optional groups it's been granted — same
/// reasoning as `set_status`.
pub const ALWAYS_ON_TOOLS: &'static [&'static str] = &["set_status", "compact"];
/// The Claude built-in tool names enabled by this group. Only
/// `WebTools` returns a non-empty slice; all other groups return `&[]`