fix(tui): name allow_shell blocker for shell tools

This commit is contained in:
cyq
2026-06-08 23:56:25 +08:00
parent 8dff2f7525
commit b721982bde
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -3244,6 +3244,10 @@ fn missing_shell_tool_error_message_names_allow_shell_gate() {
] {
let message = missing_tool_error_message(tool_name, &catalog);
assert!(message.contains("not available in the current tool catalog"));
assert!(
message.contains("allow_shell = false"),
"{tool_name}: {message}"
);
assert!(message.contains("allow_shell"), "{tool_name}: {message}");
assert!(
message.contains("/config allow_shell true"),
@@ -3272,6 +3276,7 @@ fn missing_shell_tool_error_message_keeps_allow_shell_hint_with_suggestions() {
assert!(message.contains("Did you mean:"));
assert!(message.contains("exec"));
assert!(message.contains("allow_shell = false"));
assert!(message.contains("allow_shell"));
assert!(message.contains("/config allow_shell true"));
assert!(message.contains("--save"));
+2 -1
View File
@@ -544,7 +544,8 @@ pub(super) fn missing_tool_error_message(tool_name: &str, catalog: &[Tool]) -> S
}
fn shell_tool_allow_shell_hint() -> &'static str {
"Shell tools require top-level `allow_shell = true`. \
"Shell tools are disabled because top-level `allow_shell = false`; \
they require `allow_shell = true`. \
In Agent mode, run `/config allow_shell true` for this session or add `--save` \
for future sessions; the next turn will expose shell with approval gating"
}