fix(#1548): make set_status always-on regardless of tool groups
This commit is contained in:
parent
2db94a920a
commit
a4d15cea28
3 changed files with 70 additions and 6 deletions
|
|
@ -809,7 +809,7 @@ pub struct SchedulePromptPayload {
|
|||
pub enum ToolGroup {
|
||||
/// `send`, `recv`, `ask`, `answer`
|
||||
Messaging,
|
||||
/// `set_status`, `get_agent_meta`
|
||||
/// `get_agent_meta` (`set_status` is always-on — see `ALWAYS_ON_TOOLS`)
|
||||
Meta,
|
||||
/// `get_loose_ends`, `cancel_loose_end`, `remind`, `request_next_turn`
|
||||
Inbox,
|
||||
|
|
@ -841,7 +841,7 @@ impl ToolGroup {
|
|||
pub fn tools(self) -> &'static [&'static str] {
|
||||
match self {
|
||||
Self::Messaging => &["send", "recv", "ask", "answer"],
|
||||
Self::Meta => &["set_status", "get_agent_meta"],
|
||||
Self::Meta => &["get_agent_meta"],
|
||||
Self::Inbox => &[
|
||||
"get_loose_ends",
|
||||
"cancel_loose_end",
|
||||
|
|
@ -867,6 +867,15 @@ impl ToolGroup {
|
|||
}
|
||||
}
|
||||
|
||||
/// MCP tools that are always exposed regardless of which tool groups an
|
||||
/// agent is granted. `set_status` lives here because the operator
|
||||
/// dashboard depends on every agent being able to report its status
|
||||
/// chip — gating it behind a group would let a misconfigured agent go
|
||||
/// 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"];
|
||||
|
||||
/// The Claude built-in tool names enabled by this group. Only
|
||||
/// `WebTools` returns a non-empty slice; all other groups return `&[]`
|
||||
/// (they control MCP tools via `tools()` instead).
|
||||
|
|
@ -932,7 +941,9 @@ impl ToolGroup {
|
|||
pub fn description(self) -> &'static str {
|
||||
match self {
|
||||
Self::Messaging => "send, recv, ask, answer — core agent communication",
|
||||
Self::Meta => "set_status, get_agent_meta — identity and status",
|
||||
Self::Meta => {
|
||||
"get_agent_meta — identity introspection (set_status is always available)"
|
||||
}
|
||||
Self::Inbox => {
|
||||
"get_loose_ends, cancel_loose_end, remind, request_next_turn — self-scheduling"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue