mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
feat: HANZO_AUTO_BACKGROUND_TIMEOUT=0 disables auto-backgrounding
- Setting timeout to 0 or negative now disables auto-backgrounding (uses 24h internal timeout instead of immediate backgrounding) - Updated docstrings to document the disabled behavior - hanzo-tools-shell 0.5.6, hanzo-tools-agent 0.3.1, hanzo-mcp 0.10.35
This commit is contained in:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-mcp"
|
||||
version = "0.10.34"
|
||||
version = "0.10.35"
|
||||
description = "The Zen of Hanzo MCP: One server to rule them all. The ultimate MCP that orchestrates all others."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
@@ -28,7 +28,7 @@ dependencies = [
|
||||
# Hanzo tool infrastructure (all tools)
|
||||
"hanzo-tools>=0.3.0",
|
||||
"hanzo-tools-fs>=0.1.0",
|
||||
"hanzo-tools-shell>=0.5.4",
|
||||
"hanzo-tools-shell>=0.5.6",
|
||||
"hanzo-tools-browser>=0.1.0",
|
||||
"hanzo-tools-memory>=0.1.0",
|
||||
"hanzo-tools-todo>=0.1.0",
|
||||
@@ -38,7 +38,7 @@ dependencies = [
|
||||
"hanzo-tools-config>=0.1.0",
|
||||
"hanzo-tools-refactor>=0.1.0",
|
||||
"hanzo-tools-llm>=0.1.0",
|
||||
"hanzo-tools-agent>=0.2.3",
|
||||
"hanzo-tools-agent>=0.3.1",
|
||||
"hanzo-persona>=1.0.0",
|
||||
"uvloop>=0.22.1",
|
||||
]
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-tools-agent"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
description = "Agent tools for Hanzo AI - multi-agent orchestration, CLI agents, swarms"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
@@ -18,7 +18,7 @@ classifiers = [
|
||||
keywords = ["hanzo", "tools", "agent", "swarm", "mcp", "ai"]
|
||||
dependencies = [
|
||||
"hanzo-tools>=0.3.0",
|
||||
"hanzo-tools-shell>=0.5.4",
|
||||
"hanzo-tools-shell>=0.5.6",
|
||||
"hanzo-async>=0.1.0", # Unified async I/O with uvloop
|
||||
"mcp>=1.25.0",
|
||||
"fastmcp>=2.14.1",
|
||||
|
||||
@@ -28,6 +28,7 @@ Use 'cmd' for:
|
||||
|
||||
Auto-backgrounding: Commands exceeding timeout automatically background.
|
||||
Configure via: export HANZO_AUTO_BACKGROUND_TIMEOUT=30 (default: 30s)
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=0 (disabled)
|
||||
Use ps --logs <id> to view, ps --kill <id> to stop.
|
||||
|
||||
Performance: Uses uvloop on macOS/Linux for 2-4x faster async I/O.
|
||||
|
||||
@@ -5,6 +5,7 @@ All file I/O uses hanzo_async for non-blocking operations with uvloop support.
|
||||
|
||||
Auto-backgrounding timeout can be configured via:
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=30 # seconds (default: 30)
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=0 # disable auto-backgrounding
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -24,7 +25,9 @@ from hanzo_tools.shell.truncate import truncate_response
|
||||
|
||||
# Configurable auto-background timeout (seconds)
|
||||
# Set via HANZO_AUTO_BACKGROUND_TIMEOUT env var
|
||||
AUTO_BACKGROUND_TIMEOUT = float(os.getenv("HANZO_AUTO_BACKGROUND_TIMEOUT", "30"))
|
||||
# 0 or negative = disabled (never auto-background, use 24h timeout)
|
||||
_raw_timeout = float(os.getenv("HANZO_AUTO_BACKGROUND_TIMEOUT", "30"))
|
||||
AUTO_BACKGROUND_TIMEOUT = _raw_timeout if _raw_timeout > 0 else 86400.0 # 24 hours if disabled
|
||||
|
||||
|
||||
class ProcessManager:
|
||||
@@ -120,7 +123,9 @@ class AutoBackgroundExecutor:
|
||||
the agent loop responsive. Longer timeouts only affect the background
|
||||
process lifetime, not the foreground wait time.
|
||||
|
||||
Configure via: export HANZO_AUTO_BACKGROUND_TIMEOUT=30
|
||||
Configure via:
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=30 # 30s timeout (default)
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=0 # disabled (never auto-background)
|
||||
"""
|
||||
|
||||
DEFAULT_TIMEOUT = AUTO_BACKGROUND_TIMEOUT
|
||||
@@ -474,7 +479,9 @@ class ShellExecutor:
|
||||
Ensures consistent auto-backgrounding behavior across dag, zsh, shell, bash tools.
|
||||
Uses a singleton pattern to share process management state.
|
||||
|
||||
Configure via: export HANZO_AUTO_BACKGROUND_TIMEOUT=30
|
||||
Configure via:
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=30 # 30s timeout (default)
|
||||
export HANZO_AUTO_BACKGROUND_TIMEOUT=0 # disabled (never auto-background)
|
||||
"""
|
||||
|
||||
DEFAULT_TIMEOUT = AUTO_BACKGROUND_TIMEOUT
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-tools-shell"
|
||||
version = "0.5.5"
|
||||
version = "0.5.6"
|
||||
description = "Shell/command execution tools - cmd (unified DAG), zsh, bash, fish, dash, ps, npx, uvx, open, curl, jq, wget"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
Generated
+1
-1
@@ -440,7 +440,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "hanzo-tools-shell"
|
||||
version = "0.5.2"
|
||||
version = "0.5.6"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "hanzo-async" },
|
||||
|
||||
Reference in New Issue
Block a user