fix: replace uuid.uuid4() with getID() from appPublic.uniqueID for all table ID generation
This commit is contained in:
parent
eb9a90ee42
commit
63a89d6db2
@ -1,6 +1,7 @@
|
||||
from typing import Dict, Any
|
||||
from datetime import datetime
|
||||
import uuid
|
||||
from appPublic.uniqueID import getID
|
||||
|
||||
|
||||
async def harnessed_get_agent_config(context: Dict[str, Any]) -> Dict[str, Any]:
|
||||
@ -96,7 +97,7 @@ async def harnessed_save_agent_config(context: Dict[str, Any], config_data: Dict
|
||||
await agent.db.sql(sql_update, config_data)
|
||||
else:
|
||||
# Create new config
|
||||
config_data["id"] = str(uuid.uuid4()).replace("-", "")[:32]
|
||||
config_data["id"] = getID()[:32]
|
||||
config_data["created_at"] = config_data["updated_at"]
|
||||
sql_insert = """
|
||||
INSERT INTO harnessed_agent_config (
|
||||
|
||||
@ -16,6 +16,7 @@ from typing import Dict, Any, List, Optional, Callable, Tuple
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
import uuid
|
||||
from appPublic.uniqueID import getID
|
||||
import re
|
||||
|
||||
# Import required dependencies
|
||||
@ -580,7 +581,7 @@ class HermesAgent:
|
||||
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
if action == "add":
|
||||
memory_id = str(uuid.uuid4())
|
||||
memory_id = getID()
|
||||
# Auto-classify priority if not provided
|
||||
final_priority = priority if priority is not None else self._classify_memory_priority(content, target)
|
||||
|
||||
@ -768,7 +769,7 @@ class HermesAgent:
|
||||
if not self._validate_skill_content(skill_content):
|
||||
return {"success": False, "error": "Invalid skill content", "user_id": user_id}
|
||||
|
||||
skill_id = str(uuid.uuid4())
|
||||
skill_id = getID()
|
||||
data = {
|
||||
'id': skill_id,
|
||||
'user_id': user_id,
|
||||
@ -850,7 +851,7 @@ class HermesAgent:
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
if action == "create":
|
||||
# Create new remote skill configuration
|
||||
new_skill_id = str(uuid.uuid4())
|
||||
new_skill_id = getID()
|
||||
data = {
|
||||
'id': new_skill_id,
|
||||
'user_id': user_id,
|
||||
|
||||
@ -6,6 +6,7 @@ Implements workflow parsing, parallel execution, and skill-based automation
|
||||
import asyncio
|
||||
import json
|
||||
import uuid
|
||||
from appPublic.uniqueID import getID
|
||||
from typing import Dict, Any, List, Optional, Tuple
|
||||
from datetime import datetime
|
||||
from dataclasses import dataclass
|
||||
@ -85,7 +86,7 @@ class HermesOrchestrator:
|
||||
user_id = self._get_current_user_id(context) if context else "anonymous"
|
||||
|
||||
try:
|
||||
workflow_id = str(uuid.uuid4())
|
||||
workflow_id = getID()
|
||||
env = ServerEnv()
|
||||
|
||||
dbname = env.get_module_dbname('harnessed_agent')
|
||||
@ -146,7 +147,7 @@ class HermesOrchestrator:
|
||||
if not workflows:
|
||||
return {"success": False, "error": "Workflow not found or access denied"}
|
||||
|
||||
task_id = str(uuid.uuid4())
|
||||
task_id = getID()
|
||||
data = {
|
||||
'id': task_id,
|
||||
'user_id': user_id,
|
||||
@ -431,7 +432,7 @@ class HermesOrchestrator:
|
||||
user_id: str, context: Dict[str, Any],
|
||||
max_retries: int) -> Dict[str, Any]:
|
||||
"""Execute a single task with retry logic"""
|
||||
execution_id = str(uuid.uuid4())
|
||||
execution_id = getID()
|
||||
|
||||
# Record execution start
|
||||
await self._record_execution_start(execution_id, user_id, task, context)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user