some cleanups

This commit is contained in:
teknium 2025-11-05 03:47:17 +00:00
parent ab5c9fc37b
commit c82741c3d8
15 changed files with 911 additions and 56 deletions

View file

@ -139,7 +139,7 @@ def terminal_tool(
"exit_code": -1,
"error": f"Terminal tool is disabled due to import error: {import_error}",
"status": "disabled"
})
}, ensure_ascii=False)
# Get configuration from environment
vm_lifetime_seconds = int(os.getenv("HECATE_VM_LIFETIME_SECONDS", "300"))
@ -155,7 +155,7 @@ def terminal_tool(
"exit_code": -1,
"error": "MORPH_API_KEY environment variable not set",
"status": "disabled"
})
}, ensure_ascii=False)
# Get or create VM instance and execution context
# This is critical for interactive session support - the context must persist!
@ -219,7 +219,7 @@ def terminal_tool(
"status": "active" if result.get("session_id") else "ended"
}
return json.dumps(formatted_result)
return json.dumps(formatted_result, ensure_ascii=False)
except Exception as e:
return json.dumps({
@ -229,7 +229,7 @@ def terminal_tool(
"exit_code": -1,
"error": f"Failed to execute terminal command: {str(e)}",
"status": "error"
})
}, ensure_ascii=False)
def check_hecate_requirements() -> bool:
"""