feat(self-tool): add impact prediction guidance to tool description

Prompt the model to predict potential impact before modifying runtime
state or invoking methods, and warn the user about risks that could
cause crashes or instability.
This commit is contained in:
chengyongru 2026-04-14 22:03:54 +08:00
parent b5cd23bf5e
commit 24f903b979

View File

@ -90,7 +90,11 @@ class SelfTool(Tool):
"Use 'inspect' with dot-path to explore (e.g. 'subagents._running_tasks'), "
"'modify' to change values, 'call' to invoke methods, "
"'list_tools' to see registered tools, 'manage_tool' to register/unregister, "
"'snapshot'/'restore' to save/load config templates."
"'snapshot'/'restore' to save/load config templates.\n"
"IMPORTANT: Before modifying state or invoking methods, predict the potential impact. "
"If the operation could cause crashes, data loss, or instability "
"(e.g. replacing tools, changing model, resetting critical config), "
"warn the user about the risk BEFORE executing and ask for confirmation."
)
@property