Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tests/tools/test_terminal_tool_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Regression test for the terminal tool description wording (issue #7672).

The description used to claim "Execute shell commands on a Linux environment",
which is misleading for users running locally on Windows/macOS or in a non-Linux
configured backend. Pin the invariant: the description must describe the
environment as *configured* rather than hardcoding Linux.
"""

from __future__ import annotations

from tools.terminal_tool import TERMINAL_TOOL_DESCRIPTION


def test_terminal_description_does_not_hardcode_linux():
# The core of issue #7672: don't assert every user is on Linux.
assert "Linux environment" not in TERMINAL_TOOL_DESCRIPTION


def test_terminal_description_mentions_configured_environment():
# It should frame the environment as setup-dependent, naming the real options.
assert "configured execution environment" in TERMINAL_TOOL_DESCRIPTION
assert "local machine" in TERMINAL_TOOL_DESCRIPTION
assert "Docker container" in TERMINAL_TOOL_DESCRIPTION


def test_terminal_description_keeps_persistence_contract():
# The persistence guidance the rest of the prompt relies on must survive.
assert "persist between calls" in TERMINAL_TOOL_DESCRIPTION
2 changes: 1 addition & 1 deletion tools/terminal_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ def _transform_sudo_command(command: str | None) -> tuple[str | None, str | None


# Tool description for LLM
TERMINAL_TOOL_DESCRIPTION = """Execute shell commands on a Linux environment. Filesystem, current working directory, and exported environment variables persist between calls.
TERMINAL_TOOL_DESCRIPTION = """Execute shell commands in the configured execution environment (local machine, Docker container, or cloud sandbox depending on setup — not necessarily Linux). Filesystem, current working directory, and exported environment variables persist between calls.

Do NOT use cat/head/tail to read files — use read_file instead.
Do NOT use grep/rg/find to search — use search_files instead.
Expand Down
Loading