refactor(tools): streamline built-in tool descriptions (#6201)

* refactor(tools): streamline built-in tool descriptions

* refactor(tools): retain actionable schema details
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-14 10:34:07 +08:00
1 parent 30e43aec82
commit 6b90e400e4
13 files changed
+68 -136

No files matched your search

+3 -7
View File
@@ -200,17 +200,13 @@ async def test_default_allow_set_and_public_parameter_schema_are_unchanged(
"key": {
"type": "string",
"description": (
"Dot-path for check/set. Examples: 'max_iterations', 'workspace', "
"'provider_retry_mode'. Use 'request.channel', 'request.chat_id', or "
"'request.sender_id' for current routing metadata. Use 'model_preset' "
"to switch named model presets. For check without key, shows all "
"config values."
"Dot-path for check; top-level runtime or scratchpad key for set. "
"Read-only routing metadata: request.channel, request.chat_id, request.sender_id."
),
},
"value": {
"description": (
"New value (for set). Type must match target (int for "
"max_iterations/context_window_tokens, str for model/model_preset)."
"New value for set; match the setting's type. Scratchpad accepts JSON values."
),
},
},
-5
View File
@@ -732,11 +732,6 @@ class TestReadOnlyMode:
tool = self._make_readonly_tool()
assert "READ-ONLY MODE" in tool.description
def test_description_shows_warning_when_modify_allowed(self):
tool = _make_tool()
assert "IMPORTANT" in tool.description
assert "READ-ONLY" not in tool.description
# ---------------------------------------------------------------------------
# scratchpad inspection
+5 -5
View File
@@ -204,10 +204,10 @@ class TestMessageToolSchema:
def test_schema_discourages_current_chat_replies(self) -> None:
tool = MessageTool()
assert "For a normal reply, including a scheduled reminder or report, answer naturally instead" in tool.description
assert "nanobot delivers the final reply to the current chat" in tool.description
assert "generate_image creates images in the current chat" in tool.description
assert "For normal replies, including scheduled reminders and reports, answer directly" in tool.description
assert "the final reply is delivered to the current chat automatically" in tool.description
assert "deliver generated images via media" in tool.description
assert (
"Do not use this for a normal reply in the current chat"
in tool.parameters["properties"]["content"]["description"]
"Use artifact paths returned by generate_image"
in tool.parameters["properties"]["media"]["description"]
)
+1 -1
View File
@@ -16,7 +16,7 @@ def test_coding_tool_descriptions_steer_editing_priority() -> None:
assert "default tool for code edits" in apply_patch
assert "multi-file" in apply_patch
assert "dry_run=true" in apply_patch
assert "without writing files" in ApplyPatchTool().parameters["properties"]["dry_run"]["description"]
assert "edit_file only for small exact replacements" in apply_patch
assert "small, exact replacement" in edit_file