-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspawn_webui_worker.py
More file actions
executable file
·63 lines (49 loc) · 1.94 KB
/
spawn_webui_worker.py
File metadata and controls
executable file
·63 lines (49 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python3
"""
Spawn a Bob worker to work on WebUI improvements
"""
import asyncio
import json
import sys
from pathlib import Path
from datetime import datetime, timezone
sys.path.insert(0, str(Path(__file__).parent))
from src.memory.redis_client import redis_stm
from src.orchestrator.tasks import WorkerTask
async def spawn_webui_worker():
"""Spawn a worker to improve the WebUI"""
# Initialize Redis
await redis_stm.initialize()
# Create WebUI improvement task
now = datetime.now(timezone.utc)
task_data = {
"task_id": f"webui_improve_{now.strftime('%Y%m%d_%H%M%S')}",
"thread_id": f"webui_thread_{now.strftime('%Y%m%d_%H%M%S')}",
"description": """Work on improving the Bob WebUI (Streamlit app). Focus on:
1. Fix the performance issues (it's causing VM strain)
2. Add real-time updates for Bob's thoughts
3. Improve the conversation interface
4. Add visualization for Bob's memory patterns
5. Create a better task monitoring interface
Start by analyzing the current web_ui.py implementation and identifying specific improvements.
Remember to be mindful of resource usage - we need a lightweight solution.""",
"model": "claude-3.5-sonnet",
"context_window_size": 8192,
"memory_focus": "bob_primary",
"queued_at": now.isoformat()
}
# Queue the task
task_json = json.dumps(task_data)
await redis_stm.redis.rpush("bob:task_queue", task_json)
print(f"✅ Spawned WebUI worker!")
print(f" Task ID: {task_data['task_id']}")
print(f" Thread ID: {task_data['thread_id']}")
print(f"\nThe worker will:")
print(" - Analyze current WebUI implementation")
print(" - Identify performance bottlenecks")
print(" - Propose and implement improvements")
print(" - Focus on lightweight solutions")
# Close Redis
await redis_stm.close()
if __name__ == "__main__":
asyncio.run(spawn_webui_worker())