diff --git a/model_tools.py b/model_tools.py index decc6983f..c4c58e3bb 100644 --- a/model_tools.py +++ b/model_tools.py @@ -1102,7 +1102,7 @@ def get_all_tool_names() -> List[str]: "browser_vision" ]) - # Cronjob management tools (CLI-only, checked at runtime) + # Cronjob management tools (CLI + gateway, checked at runtime) if check_cronjob_requirements(): tool_names.extend([ "schedule_cronjob", "list_cronjobs", "remove_cronjob" @@ -2349,8 +2349,8 @@ def get_available_toolsets() -> Dict[str, Dict[str, Any]]: "cronjob_tools": { "available": check_cronjob_requirements(), "tools": ["schedule_cronjob", "list_cronjobs", "remove_cronjob"], - "description": "Schedule and manage automated tasks (cronjobs) - only available in interactive CLI mode", - "requirements": ["HERMES_INTERACTIVE=1 (set automatically by cli.py)"] + "description": "Schedule and manage automated tasks (cronjobs) - available in CLI and messaging platforms", + "requirements": ["Interactive or gateway session"] }, "file_tools": { "available": check_file_requirements(), diff --git a/tools/cronjob_tools.py b/tools/cronjob_tools.py index 5db2e1c24..19dc3309c 100644 --- a/tools/cronjob_tools.py +++ b/tools/cronjob_tools.py @@ -340,9 +340,14 @@ def check_cronjob_requirements() -> bool: """ Check if cronjob tools can be used. - Only available in interactive CLI mode (HERMES_INTERACTIVE=1). + Available in interactive CLI mode and gateway/messaging platforms. + Cronjobs are server-side scheduled tasks so they work from any interface. """ - return os.getenv("HERMES_INTERACTIVE") == "1" + return bool( + os.getenv("HERMES_INTERACTIVE") + or os.getenv("HERMES_GATEWAY_SESSION") + or os.getenv("HERMES_EXEC_ASK") + ) # ============================================================================= diff --git a/toolsets.py b/toolsets.py index 771ad25f5..10e13a741 100644 --- a/toolsets.py +++ b/toolsets.py @@ -84,7 +84,7 @@ TOOLSETS = { }, "cronjob": { - "description": "Cronjob management tools - schedule, list, and remove automated tasks (CLI-only)", + "description": "Cronjob management tools - schedule, list, and remove automated tasks", "tools": ["schedule_cronjob", "list_cronjobs", "remove_cronjob"], "includes": [] },