style: ruff format on merge-touched files

This commit is contained in:
advent259141
2026-03-13 09:20:08 +08:00
parent c07fba7add
commit 3a8bfa0873
5 changed files with 14 additions and 13 deletions
+10 -6
View File
@@ -181,11 +181,13 @@ class FunctionToolExecutor(BaseFunctionToolExecutor[AstrAgentContext]):
return
# Browser tool names that require the "browser" sandbox capability.
_BROWSER_TOOL_NAMES: frozenset[str] = frozenset({
"astrbot_execute_browser",
"astrbot_execute_browser_batch",
"astrbot_run_browser_skill",
})
_BROWSER_TOOL_NAMES: frozenset[str] = frozenset(
{
"astrbot_execute_browser",
"astrbot_execute_browser_batch",
"astrbot_run_browser_skill",
}
)
@classmethod
def _check_sandbox_capability(
@@ -215,7 +217,9 @@ class FunctionToolExecutor(BaseFunctionToolExecutor[AstrAgentContext]):
"Please ask the administrator to switch to a sandbox profile with "
"browser support, or use shell/python tools instead."
)
logger.warning("[ToolExec] capability_rejected tool=%s caps=%s", tool.name, list(caps))
logger.warning(
"[ToolExec] capability_rejected tool=%s caps=%s", tool.name, list(caps)
)
return mcp.types.CallToolResult(
content=[mcp.types.TextContent(type="text", text=msg)],
isError=True,
-1
View File
@@ -799,7 +799,6 @@ def _apply_llm_safety_mode(config: MainAgentBuildConfig, req: ProviderRequest) -
# See astrbot.core.computer.computer_tool_provider for details.
def _get_compress_provider(
config: MainAgentBuildConfig, plugin_context: Context
) -> Provider | None:
-1
View File
@@ -290,7 +290,6 @@ print(
return _build_python_exec_command(script)
def _shell_exec_succeeded(result: dict) -> bool:
if "success" in result:
return bool(result.get("success"))
+1 -4
View File
@@ -327,10 +327,7 @@ class CronJobManager:
context_dump = req._print_friendly_context()
req.contexts = []
req.system_prompt += (
CONVERSATION_HISTORY_INJECT_PREFIX
+ f"---\n"
f"{context_dump}\n"
f"---\n"
CONVERSATION_HISTORY_INJECT_PREFIX + f"---\n{context_dump}\n---\n"
)
cron_job_str = json.dumps(extras.get("cron_job", {}), ensure_ascii=False)
req.system_prompt += PROACTIVE_AGENT_CRON_WOKE_SYSTEM_PROMPT.format(
+3 -1
View File
@@ -91,7 +91,9 @@ class SendMessageToUserTool(FunctionTool[AstrAgentContext]):
# Use shell to check if the file exists in sandbox
import shlex
result = await sb.shell.exec(f"test -f {shlex.quote(path)} && echo '_&exists_'")
result = await sb.shell.exec(
f"test -f {shlex.quote(path)} && echo '_&exists_'"
)
if "_&exists_" in json.dumps(result):
# Download the file from sandbox
name = os.path.basename(path)