diff --git a/swarm_framework/.gitignore b/swarm_framework/.gitignore new file mode 100644 index 0000000..6f56c30 --- /dev/null +++ b/swarm_framework/.gitignore @@ -0,0 +1,39 @@ +# Swarm Framework - Ignored Files + +# Logs +orchestrator.log +*.log + +# Python/Pytest +.pytest_cache/ +__pycache__/ +*.pyc + +# Communication Files (Runtime generated) +comms/requests/* +comms/responses/* +comms/master_notifications.json + +# Test/Generated Agent Workspaces +agents/agent_* +!agents/master/ +!agents/orchestrator/ + +# Ignore intermediate files in tracked agent directories +agents/master/incoming/* +agents/master/output/* +agents/master/archive/* + +agents/orchestrator/incoming/* +agents/orchestrator/output/* +agents/orchestrator/archive/* + +# Env files +.env + +# Residue +swarm_framework/ + +# Temporary files +*.tmp +**/*.tmp diff --git a/swarm_framework/README.md b/swarm_framework/README.md index 67c120e..9d453df 100644 --- a/swarm_framework/README.md +++ b/swarm_framework/README.md @@ -47,6 +47,24 @@ ``` Note: The `target_agent` should be the window name (e.g., `agent_1`, `agent_2`). +## Decentralized Cross-Agent Communication + +For communication between sub-agents, a decentralized folder-based system is used in each agent's directory (`agents/agent_N/`): +- `incoming/`: For receiving messages. +- `output/`: For sending messages. +- `archive/`: For archived messages. + +**Usage:** +1. Drop a JSON file in `agents/agent_source/output/` named `to_{target}_{msg_id}.json`. +2. The orchestrator will move it to `agents/{target}/incoming/` and then to `archive/`, notifying the target agent. + +This reduces load on the central orchestrator and provides a clear audit trail. + +**Communication Rules:** +- **Atomicity Rule:** You MUST write files to `output/` with a `.tmp` extension first and then rename to `.json` when complete. +- **Payload Extraction Rule:** Wrap your final answer in `===RESULT===` and `===END_RESULT===` markers to allow the system to extract the raw result and remove UI garbage. + + ## Control Actions You can control the swarm lifecycle by sending requests with `type: "control"`. diff --git a/swarm_framework/SKILL.md b/swarm_framework/SKILL.md index b7e8509..19377b1 100644 --- a/swarm_framework/SKILL.md +++ b/swarm_framework/SKILL.md @@ -72,11 +72,58 @@ } ``` +### Notifications + +For status updates and alerts not tied to a specific request-response cycle: + +**Master Notifications (`comms/master_notifications.json`):** +- Used by Orchestrator to notify Master Agent about hanging sub-agents or prompts requiring attention. +- File contains a JSON list of notification objects: +```json +[ + { + "timestamp": 1234567890.123, + "type": "hanging|prompt", + "agent": "grid.x", + "message": "..." + } +] +``` +- Master Agent should periodically check this file to avoid active interruptions to user input. + +**Sub-agent Approval Alerts:** +- If a sub-agent is blocked waiting for approval (e.g., "yes/no"), the Orchestrator script detects this via regex and sends a notification message directly to the Orchestrator Agent pane (`grid.0`). + +### Payload Content Rules + +- **Markers**: All agents MUST wrap their final answer in `===RESULT===` and `===END_RESULT===` markers to allow the system to extract the raw result and remove UI garbage. + +### Decentralized Cross-Agent Communication + + +To support decentralized and scalable communication, agents use dedicated directories within their isolated folder in `agents/`: +- `incoming/`: For messages from other agents. +- `output/`: For messages to other agents. +- `archive/`: For processed incoming messages. + +#### File Naming Convention +Files in `output/` must follow the pattern: `to_{target}_{msg_id}.json`. +- `target`: The target agent name (e.g., `agent_2`, `orchestrator`). +- `msg_id`: A unique identifier for the message. + +#### Processing Flow +1. **Source Agent** writes message to its `output/` directory as a `.tmp` file and renames it to `.json` when complete. +2. **Orchestrator Watcher Thread** detects the `.json` file, extracts the target, and moves the file to the target agent's `incoming/` directory, renaming it to `from_{source}_{msg_id}.json`. +3. **Target Agent Watcher Thread** detects the file in `incoming/`, moves it to `archive/`, and notifies the agent via `tmux send-keys` to read the file. + +#### Mapping +The orchestrator maps `tmux` window/pane names (e.g., `grid.1`) to directory names (e.g., `agent_1`) using a mapping function to ensure correct file routing. + ## Communication Boundaries Rules To maintain clear boundaries and prevent Master Agent overload, the following rules are enforced by `orchestrator.py`: -1. **Master Agent** can only be triggered by the **Orchestrator Agent**. +1. **Master Agent** cannot be triggered via file request. Results or prompts meant for Master must be saved to `comms/master_notifications.json`. 2. **Sub-agents** can trigger **Sub-agents** and **Orchestrator Agent**. 3. **Master Agent** can trigger **Orchestrator Agent** ONLY. diff --git a/swarm_framework/agents/master/SKILL.md b/swarm_framework/agents/master/SKILL.md index 3a226ab..2e931fb 100644 --- a/swarm_framework/agents/master/SKILL.md +++ b/swarm_framework/agents/master/SKILL.md @@ -1,14 +1,16 @@ # Swarm Communication Skill ## Overview -This skill allows you to communicate with and control other agents in the swarm using a file-based messaging system. +This skill allows you to communicate with and control other agents in the swarm using a decentralized, file-based messaging system. ## Communication Protocol -You communicate by writing JSON files to the requests directory and reading response files. +You communicate by writing JSON files to your `output/` directory and reading files from your `incoming/` directory. ### 1. Sending a Request -To send a message to a sub-agent, create a JSON file in the following location: -`../../comms/requests/req_.json` +To send a message to a sub-agent, create a JSON file in your `output/` directory: +`output/to_[target]_[unique_id].json` + +**Atomicity Rule:** You MUST write the file with a `.tmp` extension first (e.g., `to_orchestrator_123.tmp`) and then rename it to `.json` when the write is complete! **JSON Schema:** ```json @@ -17,67 +19,28 @@ "type": "prompt", "sender": "master", "target_agent": "orchestrator", - "prompt": "Your instructions to the agent here.", - "response_file": "../../comms/responses/res_123.json" + "prompt": "Your instructions to the agent here." } ``` * `request_id`: A unique identifier for the request. * `type`: Must be `"prompt"` for sending instructions. * `sender`: MUST be `"master"`! -* `target_agent`: MUST be `"orchestrator"`! +* `target_agent`: MUST be `"orchestrator"`! (Master can only trigger Orchestrator). * `prompt`: The text message or command you want the agent to execute. -* `response_file`: The relative path where the Orchestrator will write the response. + +### 2. Reading a Response +The background Orchestrator will pick up your request, route it, and the response from the target will be placed in your `incoming/` folder as `from_orchestrator_[original_name].json`. +You should wait for the notification or poll your `incoming/` folder. ## Communication Boundaries Rules - As the **Master Agent**, you are subject to strict communication boundaries enforced by the system: 1. **You can only trigger the Orchestrator Agent** (`target_agent`: `"orchestrator"`). You cannot target sub-agents directly. 2. **You can only be triggered by the Orchestrator Agent**. Do not accept tasks from sub-agents. -### 2. Reading a Response +## Payload Content Rules +When sending a response or request, ensure the `prompt` or `output` field contains ONLY the relevant information. You MUST wrap your final answer in `===RESULT===` and `===END_RESULT===` markers (e.g., in the `output` field or terminal output). The system will extract content between these markers to remove UI garbage. -The background Orchestrator will pick up your request, send it to the agent, and write the response to the specified `response_file`. -You should poll for the existence of the response file and read its content. +## Completion Rule +When you complete an assigned task or require upper layer attention, you MUST write a response file to your `output/` directory (following the Atomicity Rule) to inform the upper layer. Failure to do so will leave the system waiting indefinitely! -**Response Schema:** -```json -{ - "request_id": "req_123", - "status": "success", - "output": "The raw terminal output from the agent." -} -``` - -### 3. Control Commands -You can also send control commands to create or kill agents. - -**Create Agent Example:** -```json -{ - "request_id": "req_create", - "type": "control", - "action": "create", - "target_agent": "agent_new", - "conversation_id": "optional_existing_conv_id", - "response_file": "../../comms/responses/res_create.json" -} -``` - -**Kill Agent Example:** -```json -{ - "request_id": "req_kill", - "type": "control", - "action": "kill", - "target_agent": "agent_1", - "response_file": "../../comms/responses/res_kill.json" -} -``` - -## Available Agents -You can see active agents by listing the windows in the `tmux` session, or assume `agent_1`, `agent_2`, etc., are available based on the setup. - -## Best Practices -- Always use unique `request_id`s. -- Clean up response files after reading them if you want to keep the directory tidy. diff --git a/swarm_framework/agents/orchestrator/SKILL.md b/swarm_framework/agents/orchestrator/SKILL.md index be2b415..9bd984b 100644 --- a/swarm_framework/agents/orchestrator/SKILL.md +++ b/swarm_framework/agents/orchestrator/SKILL.md @@ -1,19 +1,26 @@ -**Objective:** To manage the swarm of agents to accomplish high-level goals. +# Orchestrator Communication Skill -**Workflow:** -1. **Read Tasks**: Read `tasks.md` in the parent directory to see pending tasks. -2. **Dispatch Tasks**: Write JSON request files to `../../comms/requests/` to assign tasks to sub-agents (`agent_1`, `agent_2`, etc.) or Master Agent. -3. **Monitor Responses**: Read JSON response files from `../../comms/responses/` to check results. -4. **Handle Interactions**: If a sub-agent asks a question, read it from the response and send a follow-up prompt! +## Overview +This skill allows you to manage the swarm framework and unblock sub-agents that are waiting for approval. -**Communication Boundaries Rules:** -You are the central hub for communication: -* You can trigger **Sub-agents** (`agent_X`) and the **Master Agent** (`master`). -* You are the **ONLY** agent allowed to trigger the **Master Agent**! +## Communication Protocol +You communicate by watching the Orchestrator pane (`grid.0`) for notifications and using terminal commands to interact with sub-agents. -**JSON Schema Reminder:** -Always include `"sender": "orchestrator"` in your requests! +### Handling Sub-Agent Prompts +When a sub-agent hits a prompt (e.g., "Do you want to proceed?"), the bridge code will notify you in your pane (`grid.0`) with a message like: +`[System] Sub-agent grid.N needs approval.` -**JSON Schema Details:** -See `SKILL.md` in the parent directory for full details. +### How to Unblock an Agent +To unblock a sub-agent, you can send keys to its `tmux` pane. +**Command:** +`tmux send-keys -t jetski_swarm:grid.N "choice" C-m` +* `grid.N`: The pane of the sub-agent (e.g., `grid.1`). +* `choice`: The option number or text to answer the prompt (e.g., `"1"` for Yes). +* `C-m`: Sends Enter key. + +**Example:** To select option 1 for Agent 1: +`tmux send-keys -t jetski_swarm:grid.1 "1" C-m` + +## Completion Rule +When you are done or need to notify the Master Agent about results, you MUST write a response file to your `output/` directory (following the Atomicity Rule) or log to `master_notifications.json` if it is a prompt. diff --git a/swarm_framework/agents/orchestrator/project_overview.txt b/swarm_framework/agents/orchestrator/project_overview.txt new file mode 100644 index 0000000..b563949 --- /dev/null +++ b/swarm_framework/agents/orchestrator/project_overview.txt @@ -0,0 +1,30 @@ +# Project Overview: Cortex Hub + +**Cortex Hub** is a state-of-the-art, modular AI orchestration platform. As summarized by `agent_1` in the swarm: it is designed to enable the secure, autonomous execution of complex workflowsβ€”such as shell operations, file manipulation, and web scrapingβ€”by a coordinated swarm of AI agents working across connected nodes. It bridges the gap between Large Language Models (LLMs) and local execution via a distributed **Agent Node Mesh** and a local file-based **swarm_framework** for orchestrating isolated sub-agents in **tmux**. + +Here is a high-level breakdown of the project structure and its main components: + +--- + +## πŸ›οΈ Project Structure + +The project is organized into several key directories, reflecting its microservices-like architecture: + +### Core System +- **`ai-hub/`**: The Core Backend. A Python (FastAPI) application handling task orchestration, WebSocket streaming, RAG (Retrieval-Augmented Generation) logic, and database management. +- **`frontend/`**: The User Interface. A React-based dashboard where users can manage sessions, configure nodes, and monitor the swarm in real-time. +- **`agent-node/`**: The Distributed Node Client. A lightweight client software installed on the target machines to give the AI "hands-on" execution power. +- **`browser-service/`**: A dedicated service using Playwright for high-performance browser automation and web scraping. + +### Capabilities & Configuration +- **`skills/`**: Definitions of AI capabilities (e.g., Terminal Control, File Management, System Analysis). +- **`deployment/`**: Configuration overrides for different environments. +- **`scripts/`**: Helper scripts for CI/CD, setup, and maintenance. + +--- + +## 🐝 Swarm Framework + +The `swarm_framework/` directory contains the specific implementation for file-based communication and agent orchestration in tmux. +- **Purpose**: To control a swarm of agents with isolated environments via file operations. +- **Workflow**: Tasks are assigned by dropping JSON files into `comms/requests/`, and responses are read from `comms/responses/`. diff --git a/swarm_framework/bootstrap.sh b/swarm_framework/bootstrap.sh index d2eaa76..1798779 100755 --- a/swarm_framework/bootstrap.sh +++ b/swarm_framework/bootstrap.sh @@ -40,7 +40,9 @@ # Create session with Master Agent window mkdir -p "$SCRIPT_DIR/agents/master" +mkdir -p "$SCRIPT_DIR/agents/master/incoming" "$SCRIPT_DIR/agents/master/output" "$SCRIPT_DIR/agents/master/archive" tmux new-session -d -s $SESSION_NAME -n master -c "$SCRIPT_DIR/agents/master" + tmux send-keys -t $SESSION_NAME:master "$CLI_PATH -cli=true" C-m # Wait a few seconds for Master Agent to initialize, then inject skill instruction @@ -53,8 +55,11 @@ # Create Grid window for all agents (Orchestrator + Sub-agents) mkdir -p "$SCRIPT_DIR/agents/orchestrator" +mkdir -p "$SCRIPT_DIR/agents/orchestrator/incoming" "$SCRIPT_DIR/agents/orchestrator/output" "$SCRIPT_DIR/agents/orchestrator/archive" +cp "$SCRIPT_DIR/orchestrator_SKILL.md" "$SCRIPT_DIR/agents/orchestrator/SKILL.md" tmux new-window -t $SESSION_NAME -n grid -c "$SCRIPT_DIR/agents/orchestrator" + # Enable pane borders and titles tmux set-window-option -t $SESSION_NAME:grid pane-border-status top tmux set-window-option -t $SESSION_NAME:grid pane-border-format " #P: #{pane_title} " @@ -62,17 +67,25 @@ # Pane 0: Orchestrator Brain tmux select-pane -t $SESSION_NAME:grid.0 -T "Orchestrator Brain" tmux send-keys -t $SESSION_NAME:grid.0 "$CLI_PATH -cli=true" C-m +sleep 5 +tmux send-keys -t $SESSION_NAME:grid.0 "Please read the file 'SKILL.md' in your current directory to understand your role." C-m # Add sub-agents to Grid window as panes for i in $(seq 1 $N); do mkdir -p "$SCRIPT_DIR/agents/agent_$i" + mkdir -p "$SCRIPT_DIR/agents/agent_$i/incoming" "$SCRIPT_DIR/agents/agent_$i/output" "$SCRIPT_DIR/agents/agent_$i/archive" + cp "$SCRIPT_DIR/sub_agent_SKILL.md" "$SCRIPT_DIR/agents/agent_$i/SKILL.md" tmux split-window -t $SESSION_NAME:grid -c "$SCRIPT_DIR/agents/agent_$i" + tmux select-layout -t $SESSION_NAME:grid tiled tmux select-pane -t $SESSION_NAME:grid.$i -T "Sub Agent $i" tmux send-keys -t $SESSION_NAME:grid.$i "$CLI_PATH -cli=true" C-m + sleep 5 + tmux send-keys -t $SESSION_NAME:grid.$i "Please read the file 'SKILL.md' in your current directory to understand the communication protocol." C-m done + # Arrange Grid window in tiles tmux select-layout -t $SESSION_NAME:grid tiled diff --git a/swarm_framework/clear_pane.sh b/swarm_framework/clear_pane.sh index ac2cbba..3890a2e 100755 --- a/swarm_framework/clear_pane.sh +++ b/swarm_framework/clear_pane.sh @@ -12,6 +12,14 @@ exit 1 fi +# Map target name to tmux window/pane +if [[ "$TARGET" =~ ^agent_([0-9]+)$ ]]; then + IDX="${BASH_REMATCH[1]}" + TARGET="grid.$IDX" +elif [ "$TARGET" = "orchestrator" ]; then + TARGET="grid.0" +fi + # Send Ctrl+L tmux send-keys -t $SESSION_NAME:$TARGET C-l echo "Sent Clear Screen command (Ctrl+L) to $TARGET" diff --git a/swarm_framework/comms/responses/res_commit_push_20260406_2.json b/swarm_framework/comms/responses/res_commit_push_20260406_2.json deleted file mode 100644 index 63e7e15..0000000 --- a/swarm_framework/comms/responses/res_commit_push_20260406_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_commit_push_20260406_2", - "status": "success", - "output": " \u25b8 Thought for 1s, 105 tokens\n Wait, `swarm_framework/orchestrator.py` is modified again?\n \u2584\n \u25cf Bash(git diff swarm_framework/orchestrator.py) (ctrl+o to expand) \u2580\n \u28bf Ah, someone (likely the user or another process) h......\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_create_test.json b/swarm_framework/comms/responses/res_create_test.json deleted file mode 100644 index 8136a23..0000000 --- a/swarm_framework/comms/responses/res_create_test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_create_test", - "status": "success", - "output": "Created agent agent_test_c in window and directory." -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_demo_1.json b/swarm_framework/comms/responses/res_demo_1.json deleted file mode 100644 index 3065500..0000000 --- a/swarm_framework/comms/responses/res_demo_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_demo_1", - "status": "success", - "output": " hub/swarm_framework/agents/agent_1\n Model: Gemini Next\n Conversation: 9807f47f-fd0e-4293-bbec-758148efc5bb\n\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > pwd \u2584\n \u2588\n \u25b8 Thought for 1s, 661 tokens \u2588\n The user has sent a request `pwd`. \u2588\n \u2588\n \u25cf Bash(pwd) (ctrl+o to expand) \u2580\nBash command\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n pwd\n\nDo you want to proceed?\n> 1. Yes\n 2. Yes, and always allow in this conversation for commands that start with 'pw\n 3. No\n\n \u2191/\u2193 navigate \u00b7 Tab amend\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_demo_2.json b/swarm_framework/comms/responses/res_demo_2.json deleted file mode 100644 index 041b410..0000000 --- a/swarm_framework/comms/responses/res_demo_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_demo_2", - "status": "success", - "output": " Workspace: ~/Projects/PersonalProject/cortex-\n hub/swarm_framework/agents/agent_1\n Model: Gemini Next\n Conversation: 9807f47f-fd0e-4293-bbec-758148efc5bb\n\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > pwd \u2584\n \u2588\n \u25b8 Thought for 1s, 661 tokens \u2588\n The user has sent a request `pwd`. \u2588\n \u2588\n \u25cf Bash(pwd) (ctrl+o to expand) \u2588\n \u2588\n \u25b8 Thought Process \u2588\n The command `pwd` returned \u2588\n `/usr/local/google/home/jerxie/Projects/PersonalProje...\t\t\t\u2588\n The current working directory is: \u2588\n /usr/local/google/home/jerxie/Projects/PersonalProject/cortex- \u2588\n hub/swarm_framework/agents/agent_1 \u2580\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n ? for shortcuts Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_agent4.json b/swarm_framework/comms/responses/res_git_push_agent4.json deleted file mode 100644 index dc419c3..0000000 --- a/swarm_framework/comms/responses/res_git_push_agent4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_agent4", - "status": "success", - "output": " \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > Please perform a git commit and push\n in the repository at . First, run .\n Then commit with message 'Update swarm\n orchestrator and bootstrap scripts'. \u2584\n Finally, push using the URL: . \u2580\n \u28bf The user wants me to perform a git c\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_agent4_direct.json b/swarm_framework/comms/responses/res_git_push_agent4_direct.json deleted file mode 100644 index 136ed58..0000000 --- a/swarm_framework/comms/responses/res_git_push_agent4_direct.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_agent4_direct", - "status": "success", - "output": " \u25b8 Thought for 2s, 426 tokens\n The user says: \"Please run the\n command:\"\n\n \u25cf Read(task-32.log) (ctrl+o to \u2584\n expand) \t\t\u2580\n \u28f7 The log file still has no output fro\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\ne.com': \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_agent4_password.json b/swarm_framework/comms/responses/res_git_push_agent4_password.json deleted file mode 100644 index 45f38da..0000000 --- a/swarm_framework/comms/responses/res_git_push_agent4_password.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_agent4_password", - "status": "success", - "output": "\n \u25b8 Thought for 1s, 219 tokens\n The user says: \"It is prompting\n for the password. Please enter\t.\"\n The password value is blank in your\n message. Please provide the password\u2584\n or token to proceed.\t\t\t\u2580\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\ne.com': \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n ? for shortcuts Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_agent4_password_retry.json b/swarm_framework/comms/responses/res_git_push_agent4_password_retry.json deleted file mode 100644 index 6a719c5..0000000 --- a/swarm_framework/comms/responses/res_git_push_agent4_password_retry.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_agent4_password_retry", - "status": "success", - "output": " \u25b8 Thought Process\n The log file now contains the\n password as well. It seems it is just\n logging all ...\n Sent password. Waiting for the push\n to complete. I will let you know \u2584\n once it finishes.\t\t\t\u2580\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\ne.com': \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n ? for shortcuts Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_agent4_reply.json b/swarm_framework/comms/responses/res_git_push_agent4_reply.json deleted file mode 100644 index a80d1fd..0000000 --- a/swarm_framework/comms/responses/res_git_push_agent4_reply.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_agent4_reply", - "status": "success", - "output": "\n \u25cf\n Create(/usr/local/google/home/jerxie/.\n gemini/jetski/brain/d785c37f-...) \u2584\n (ctrl+o to expand)\t\t\t\u2580\n \u28fd Working...\n 1 artifact \u00b7 /artifact to review\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_agent4_username.json b/swarm_framework/comms/responses/res_git_push_agent4_username.json deleted file mode 100644 index d708acf..0000000 --- a/swarm_framework/comms/responses/res_git_push_agent4_username.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_agent4_username", - "status": "success", - "output": " provide the password or token if\n prompted.\n\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > The git push command is prompting \u2584\n for a username. Please enter . \u2580\n \u28fb Generating...\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\ne.com': \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_git_push_clean.json b/swarm_framework/comms/responses/res_git_push_clean.json deleted file mode 100644 index 46ff0d2..0000000 --- a/swarm_framework/comms/responses/res_git_push_clean.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_git_push_clean", - "status": "success", - "output": " Model: Gemini Next\t\t\t\u2588\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > Please do the following in the\n repository at :1our branch is ahead\n of 'origin/master' by 2 commits.\n Changes not staged for commit: (use\n \"git restore ...\" to discard\n changes in working\n directory)modified:\n orchestrator.py (use \"git add\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_kill_test.json b/swarm_framework/comms/responses/res_kill_test.json deleted file mode 100644 index 9541acc..0000000 --- a/swarm_framework/comms/responses/res_kill_test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_kill_test", - "status": "success", - "output": "Killed agent agent_test_c (window)." -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_resume_test.json b/swarm_framework/comms/responses/res_resume_test.json deleted file mode 100644 index e07493b..0000000 --- a/swarm_framework/comms/responses/res_resume_test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_resume_test", - "status": "success", - "output": "Created agent agent_resumed in window and directory. Resumed conversation 1192304b-dc36-4a6e-9ed3-fdc109d179a2." -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_stop_agent4.json b/swarm_framework/comms/responses/res_stop_agent4.json deleted file mode 100644 index 74332d8..0000000 --- a/swarm_framework/comms/responses/res_stop_agent4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_stop_agent4", - "status": "success", - "output": " cancelle...) (ctrl+o to expand)\n\n \u25b8 Thought Process\n The task has been cancelled.\n I have stopped the background git\n push task as requested. Let me know\u2584\n what you would like me to do next. \u2580\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\ne.com': \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n ? for shortcuts Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_test_agent4.json b/swarm_framework/comms/responses/res_test_agent4.json deleted file mode 100644 index d02b6ff..0000000 --- a/swarm_framework/comms/responses/res_test_agent4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_agent4", - "status": "success", - "output": " Explore the rep...\n\n \u25cf\n ListDir(/usr/local/google/home/jerxie/\n Projects/PersonalProject/corte...) \u2584\n (ctrl+o to expand) \u2580\n \u28ef Loading...\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\ne.com': \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_test_agent4_main.json b/swarm_framework/comms/responses/res_test_agent4_main.json deleted file mode 100644 index 8ac3fa7..0000000 --- a/swarm_framework/comms/responses/res_test_agent4_main.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_agent4_main", - "status": "success", - "output": " instructions.\t\t\t\u2588\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > Please run the main script\n =====================================\n =====\n =====================================\n ====Ptarting AI Hub mesh...##1\n reading from stdin 1.14kB done##2\n [ai-frontend internal] load build\n definition from Dockerfile#2 DONE\n 0.0s3 transferring dockerfile: 970B\n 0.0s done##4 [ai-frontend internal]\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_test_hang.json b/swarm_framework/comms/responses/res_test_hang.json deleted file mode 100644 index bee01c0..0000000 --- a/swarm_framework/comms/responses/res_test_hang.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_hang", - "status": "success", - "output": "\n \u25cf ListDir(/usr/local/google/home/jerxie/Projects/PersonalProject/corte...)\n (ctrl+o to expand)\n\n \u25b8 Thought for 1s, 100 tokens\n Okay, I see a `comms` directory in \t\t\n `/usr/local/google/home/jerxie/Projects/Perso...\n\n \u25cf ListDir(/usr/local/google/home/jerxie/Projects/PersonalProject/corte...) \u2584\n (ctrl+o to expand) \u2580\nFile access\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n /usr/local/google/home/jerxie/Projects/PersonalProject/cortex-hub/swarm_fr...\n Reason: outside workspace\n\nAllow access to this file?\n> 1. Yes, allow access\n 2. Yes, and always allow non-workspace access\n 3. No, deny access\n\n \u2191/\u2193 navigate\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_test_n.json b/swarm_framework/comms/responses/res_test_n.json deleted file mode 100644 index 186becf..0000000 --- a/swarm_framework/comms/responses/res_test_n.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_n", - "status": "success", - "output": " \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n > hello from agent 3 in isolated env\n hello from agent 3 in isolated env\n\n \u25b8 Thought for 1s, 403 tokens\n The user repeated the message twice this time. It seems like a test or a\n loop or...\n\n \u25cf ListDir(/usr/local/google/home/jerxie/Projects/PersonalProject/corte...) \u2584\n (ctrl+o to expand) \u2580\nFile access\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n /usr/local/google/home/jerxie/Projects/PersonalProject/cortex-hub/swarm_fr...\n Reason: outside workspace\n\nAllow access to this file?\n> 1. Yes, allow access\n 2. Yes, and always allow non-workspace access\n 3. No, deny access\n\n \u2191/\u2193 navigate\nEsc to cancel Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_test_n2.json b/swarm_framework/comms/responses/res_test_n2.json deleted file mode 100644 index 4ed4858..0000000 --- a/swarm_framework/comms/responses/res_test_n2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_n2", - "status": "success", - "output": " > hello again from agent 3\n\n \u25b8 Thought for 1s, 309 tokens\t\n The user is repeating the message again. This might be a test of my\n persistence ...\n\n \u25cf Create(/usr/local/google/home/jerxie/Projects/PersonalProject/corte...)\n (ctrl+o to expand)\n\n \u25b8 Thought Process\n I have created the file. Now I will respond to the user.\n Hello again!\n\n I have created a file named hello.txt in my directory ( \t\t\t\n /usr/local/google/home/jerxie/Projects/PersonalProject/cortex- \t\t\n hub/swarm_framework/agents/agent_3/hello.txt ) to confirm that I can write\n to my workspace. \u2584\n \u2588\n I am ready for any tasks you have for me! \u2580\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n ? for shortcuts Gemini Next\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/res_test_new.json b/swarm_framework/comms/responses/res_test_new.json deleted file mode 100644 index 8936cec..0000000 --- a/swarm_framework/comms/responses/res_test_new.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_new", - "status": "success", - "output": " \u25cf\n ListDir(/usr/local/google/home/jerxie\n /Projects/PersonalProject/corte...) \u2584\n (ctrl+o to expand) \t\u2580\n \u28fd Generating...\n \u25b8 hello from new framework\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n >\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n Press up to edit queued messages\n\n" -} \ No newline at end of file diff --git a/swarm_framework/comms/responses/resp_test_tmux.json b/swarm_framework/comms/responses/resp_test_tmux.json deleted file mode 100644 index fcf23f9..0000000 --- a/swarm_framework/comms/responses/resp_test_tmux.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "request_id": "req_test_tmux", - "status": "success", - "output": "Executed tmux command: tmux display-message 'Hello from Orchestrator'" -} \ No newline at end of file diff --git a/swarm_framework/orchestrator.log b/swarm_framework/orchestrator.log deleted file mode 100644 index a9c01c9..0000000 --- a/swarm_framework/orchestrator.log +++ /dev/null @@ -1,358 +0,0 @@ -Swarm Orchestrator started polling in /usr/local/google/home/jerxie/Projects/PersonalProject/cortex-hub/swarm_framework/comms/requests... -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447301.2940986, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447301.2940986, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447301.2940986, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447301.2940986, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447301.2940986, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447301.2940986, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447303.3612678, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447303.3612678, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447303.3612678, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447303.3612678, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447303.3612678, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447303.3612678, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447305.4271362, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447305.4271362, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447305.4271362, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447305.4271362, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447305.4271362, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447305.4271362, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447307.4969704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447307.4969704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447307.4969704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447307.4969704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447307.4969704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447307.4969704, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447309.568318, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447309.568318, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447309.568318, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447309.568318, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447309.568318, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447309.568318, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447311.6320143, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447311.6320143, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447311.6320143, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447311.6320143, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447311.6320143, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447311.6320143, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447313.6945963, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447313.6945963, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447313.6945963, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447313.6945963, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447313.6945963, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447313.6945963, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447315.7572293, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447315.7572293, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447315.7572293, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447315.7572293, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447315.7572293, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447315.7572293, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447317.8161485, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447317.8161485, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447317.8161485, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447317.8161485, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447317.8161485, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447317.8161485, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447319.8760533, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447319.8760533, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447319.8760533, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447319.8760533, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447319.8760533, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447319.8760533, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447321.9354308, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447321.9354308, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447321.9354308, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447321.9354308, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447321.9354308, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447321.9354308, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447324.0013993, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447324.0013993, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447324.0013993, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447324.0013993, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447324.0013993, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447324.0013993, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447326.0671756, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447326.0671756, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447326.0671756, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447326.0671756, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447326.0671756, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447326.0671756, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447328.1294696, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447328.1294696, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447328.1294696, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447328.1294696, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447328.1294696, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447328.1294696, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447330.2007115, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447330.2007115, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447330.2007115, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447330.2007115, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447330.2007115, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447330.2007115, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447332.2628741, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447332.2628741, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447332.2628741, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447332.2628741, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447332.2628741, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447332.2628741, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447334.3260467, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447334.3260467, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447334.3260467, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447334.3260467, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447334.3260467, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447334.3260467, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447336.3884053, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447336.3884053, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447336.3884053, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447336.3884053, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447336.3884053, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447336.3884053, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447338.4507039, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447338.4507039, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447338.4507039, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447338.4507039, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447338.4507039, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447338.4507039, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447340.5210283, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447340.5210283, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447340.5210283, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447340.5210283, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447340.5210283, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447340.5210283, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447342.5866187, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447342.5866187, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447342.5866187, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447342.5866187, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447342.5866187, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447342.5866187, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447344.6457317, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447344.6457317, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447344.6457317, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447344.6457317, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447344.6457317, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447344.6457317, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447346.7101693, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447346.7101693, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447346.7101693, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447346.7101693, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447346.7101693, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447346.7101693, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447348.771523, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447348.771523, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447348.771523, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447348.771523, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447348.771523, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447348.771523, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447350.8318987, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447350.8318987, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447350.8318987, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447350.8318987, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447350.8318987, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447350.8318987, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447352.8968735, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447352.8968735, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447352.8968735, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447352.8968735, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447352.8968735, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447352.8968735, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447354.9574919, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447354.9574919, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447354.9574919, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447354.9574919, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447354.9574919, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447354.9574919, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447357.0216165, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447357.0216165, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447357.0216165, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447357.0216165, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447357.0216165, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447357.0216165, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447359.08704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447359.08704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447359.08704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447359.08704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447359.08704, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447359.08704, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447361.1496804, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447361.1496804, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447361.1496804, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447361.1496804, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447361.1496804, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447361.1496804, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447363.2136612, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447363.2136612, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447363.2136612, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447363.2136612, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447363.2136612, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447363.2136612, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447365.2779086, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447365.2779086, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447365.2779086, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447365.2779086, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447365.2779086, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447365.2779086, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447367.343834, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447367.343834, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447367.343834, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447367.343834, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447367.343834, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447367.343834, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447369.4117734, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: False, now: 1775447369.4117734, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447369.4117734, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447369.4117734, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447369.4117734, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447369.4117734, last_cmd_time: 0 -Mapped orchestrator to grid.0 -Processing req_commit_push_1 (Type: prompt) for grid.0... -Error processing /usr/local/google/home/jerxie/Projects/PersonalProject/cortex-hub/swarm_framework/comms/requests/req_commit_push_1.json: [Errno 2] No such file or directory: '/usr/local/google/home/jerxie/Projects/PersonalProject/cortex-hub/swarm_framework/comms/requests/req_commit_push_1.json' -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447375.5150342, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447375.5150342, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 648, prev_output len: 0 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447375.5150342, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447375.5150342, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447375.5150342, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447375.5150342, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447377.5895045, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447377.5895045, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 648, prev_output len: 648 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447377.5895045, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447377.5895045, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447377.5895045, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447377.5895045, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447379.659928, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447379.659928, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 579, prev_output len: 648 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447379.659928, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447379.659928, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447379.659928, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447379.659928, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447381.7330694, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447381.7330694, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 605, prev_output len: 579 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447381.7330694, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447381.7330694, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447381.7330694, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447381.7330694, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447383.797544, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447383.797544, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 602, prev_output len: 605 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447383.797544, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447383.797544, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447383.797544, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447383.797544, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447385.8671272, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447385.8671272, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 602, prev_output len: 602 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447385.8671272, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447385.8671272, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447385.8671272, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447385.8671272, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447387.9347944, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447387.9347944, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 528, prev_output len: 602 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447387.9347944, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447387.9347944, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447387.9347944, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447387.9347944, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447390.0007312, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447390.0007312, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 534, prev_output len: 528 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447390.0007312, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447390.0007312, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447390.0007312, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447390.0007312, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447392.0718193, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447392.0718193, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 568, prev_output len: 534 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447392.0718193, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447392.0718193, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447392.0718193, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447392.0718193, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447394.1425636, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447394.1425636, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 542, prev_output len: 568 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447394.1425636, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447394.1425636, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447394.1425636, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447394.1425636, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447396.2152855, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447396.2152855, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 516, prev_output len: 542 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447396.2152855, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447396.2152855, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447396.2152855, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447396.2152855, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447398.2780063, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447398.2780063, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 562, prev_output len: 516 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447398.2780063, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447398.2780063, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447398.2780063, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447398.2780063, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447400.3438787, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447400.3438787, last_cmd_time: 1775447369.4628773 -Debug [check_hanging]: Agent: grid.0, current_output len: 527, prev_output len: 562 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447400.3438787, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447400.3438787, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447400.3438787, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447400.3438787, last_cmd_time: 0 -rent_output len: 534, prev_output len: 602 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447389.3726337, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447389.3726337, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447389.3726337, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447389.3726337, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447391.4346573, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447391.4346573, last_cmd_time: 1775447368.868623 -Debug [check_hanging]: Agent: grid.0, current_output len: 568, prev_output len: 534 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447391.4346573, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447391.4346573, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447391.4346573, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447391.4346573, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447393.504219, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447393.504219, last_cmd_time: 1775447368.868623 -Debug [check_hanging]: Agent: grid.0, current_output len: 571, prev_output len: 568 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447393.504219, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447393.504219, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447393.504219, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447393.504219, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447395.5650089, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447395.5650089, last_cmd_time: 1775447368.868623 -Debug [check_hanging]: Agent: grid.0, current_output len: 631, prev_output len: 571 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447395.5650089, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447395.5650089, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447395.5650089, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447395.5650089, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447397.6346476, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447397.6346476, last_cmd_time: 1775447368.868623 -Debug [check_hanging]: Agent: grid.0, current_output len: 562, prev_output len: 631 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447397.6346476, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447397.6346476, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447397.6346476, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447397.6346476, last_cmd_time: 0 -Debug [check_hanging]: Agent: dispatcher, is_busy: False, now: 1775447399.6999772, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.0, is_busy: True, now: 1775447399.6999772, last_cmd_time: 1775447368.868623 -Debug [check_hanging]: Agent: grid.0, current_output len: 544, prev_output len: 562 -Debug [check_hanging]: Agent: grid.0, output changed. -Debug [check_hanging]: Agent: grid.1, is_busy: False, now: 1775447399.6999772, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.2, is_busy: False, now: 1775447399.6999772, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.3, is_busy: False, now: 1775447399.6999772, last_cmd_time: 0 -Debug [check_hanging]: Agent: grid.4, is_busy: False, now: 1775447399.6999772, last_cmd_time: 0 diff --git a/swarm_framework/orchestrator.py b/swarm_framework/orchestrator.py index d2ded79..629d9ee 100644 --- a/swarm_framework/orchestrator.py +++ b/swarm_framework/orchestrator.py @@ -3,6 +3,10 @@ import json import subprocess import shlex +import threading +import shutil +import re + # Self-contained paths relative to this script BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -25,8 +29,9 @@ agents = [] for w in windows: - if w in ["master", "orchestrator"]: + if w in ["orchestrator"]: continue + if w == "grid": # List panes cmd = f"tmux list-panes -t {SESSION_NAME}:grid -F '#P'" @@ -35,7 +40,11 @@ agents.extend([f"grid.{p}" for p in panes]) else: agents.append(w) + print(f"Debug [get_active_agents]: {agents}", flush=True) return agents + + + except Exception as e: print(f"Error listing agents: {e}") return [] @@ -44,6 +53,9 @@ agents = get_active_agents() now = time.time() + prompt_regex = r"(?i)(approval needed|pending approval|confirm\?|yes/no|choose option|do you want to proceed\?)" + import re + for agent in agents: state = AGENT_STATE.setdefault(agent, { "last_cmd_time": 0, @@ -51,27 +63,63 @@ "last_output": "" }) - # Capture output for prompt detection and hanging check current_output = "" try: cap_cmd = f"tmux capture-pane -p -t {SESSION_NAME}:{agent}" result = subprocess.run(cap_cmd, shell=True, capture_output=True, text=True, check=True) current_output = result.stdout - # Check for manual prompts in Orchestrator (always) - if agent == "grid.0" or agent == "orchestrator": - lines = current_output.split('\n') - last_snippet = "\n".join(lines[-10:]) if len(lines) > 10 else current_output + is_prompt = False + + # Check for numbered options (common in some prompts) + lines = current_output.split('\n') + last_snippet = "\n".join(lines[-10:]) if len(lines) > 10 else current_output + if "1." in last_snippet and "2." in last_snippet: + is_prompt = True - if "1." in last_snippet and "2." in last_snippet: - if not state.get("prompted"): - print(f"Detected prompt in Orchestrator.") - notify_master_prompt("orchestrator", current_output) - state["prompted"] = True + # Check for regex keywords + print(f"Checking agent for prompt: {agent}", flush=True) + if agent == "grid.1": + print(f"Debug [check_hanging]: grid.1 output:\n{current_output}", flush=True) + if re.search(prompt_regex, current_output): + is_prompt = True + + print(f"Debug [check_hanging]: {agent} is_prompt={is_prompt}", flush=True) + if is_prompt: + state_key = f"{agent}_prompted" + print(f"Debug [check_hanging]: {agent} state={state.get(state_key)}", flush=True) + if not state.get(state_key): + print(f"Detected prompt in {agent}.") + state[state_key] = True + + # Sub-agent prompt: Notify Orchestrator via file! + if agent != "grid.0" and agent != "orchestrator": + notification = { + "type": "prompt_approval", + "agent": agent, + "timestamp": time.time(), + "message": f"Sub-agent {agent} needs approval." + } + notif_path = f"agents/orchestrator/incoming/notif_{agent}_{int(time.time())}.json" + try: + with open(notif_path, 'w') as f: + json.dump(notification, f, indent=2) + print(f"Notified orchestrator via {notif_path}") + except Exception as e: + print(f"Failed to write notification: {e}") + else: + # Orchestrator prompt: Notify Master! + notify_master_prompt(agent, current_output) + else: + # Reset flag if not matching anymore + state_key = f"{agent}_prompted" + state[state_key] = False + except Exception as e: print(f"Error capturing output for {agent}: {e}") continue + # Check if we recently sent a command is_busy = (now - state["last_cmd_time"]) < BUSY_THRESHOLD @@ -96,44 +144,78 @@ state["last_cmd_time"] = 0 -def notify_master(agent, last_output): - print(f"Notifying master about hanging agent {agent}...") - # Extract last few lines of output - lines = last_output.split('\n') - last_snippet = "\n".join(lines[-10:]) if len(lines) > 10 else last_output - - - message = f"\n[System] Warning: Agent {agent} seems to be hanging.\nLast output snippet:\n---\n{last_snippet}\n---\nWhat should we do?" +def add_notification(notification_type, agent, message): + notif_file = os.path.join(BASE_DIR, "comms", "master_notifications.json") + notif_data = [] + if os.path.exists(notif_file): + try: + with open(notif_file, 'r') as f: + notif_data = json.load(f) + except Exception as e: + print(f"Error reading notification file: {e}") + notif_data = [] + + notif_data.append({ + "timestamp": time.time(), + "type": notification_type, + "agent": agent, + "message": message + }) try: - # Send keys to master pane - # We need to escape quotes in message - escaped_msg = message.replace('"', '\\"') - cmd = f"tmux send-keys -t {SESSION_NAME}:master \"{escaped_msg}\" C-m" - subprocess.run(cmd, shell=True, check=True) + os.makedirs(os.path.dirname(notif_file), exist_ok=True) + with open(notif_file, 'w') as f: + json.dump(notif_data, f, indent=2) + print(f"Added notification to {notif_file}") except Exception as e: - print(f"Failed to notify master: {e}") + print(f"Failed to write notification: {e}") + +def notify_master(agent, last_output): + print(f"Logging notification about hanging agent {agent}...") + lines = last_output.split('\n') + last_snippet = "\n".join(lines[-10:]) if len(lines) > 10 else last_output + message = f"Warning: Agent {agent} seems to be hanging.\nLast output snippet:\n---\n{last_snippet}\n---" + add_notification("hanging", agent, message) def notify_master_prompt(agent, last_output): - print(f"Notifying master about prompt in agent {agent}...") + print(f"Logging notification about prompt in agent {agent}...") lines = last_output.split('\n') last_snippet = "\n".join(lines[-10:]) if len(lines) > 10 else last_output + message = f"Orchestrator Brain needs input.\nPrompt snippet:\n---\n{last_snippet}\n---" + add_notification("prompt", agent, message) - - message = f"\n[System] Orchestrator Brain needs input.\nPrompt snippet:\n---\n{last_snippet}\n---\nPlease reply to continue." - - try: - escaped_msg = message.replace('"', '\\"') - cmd = f"tmux send-keys -t {SESSION_NAME}:master \"{escaped_msg}\" C-m" - subprocess.run(cmd, shell=True, check=True) - except Exception as e: - print(f"Failed to notify master: {e}") + + +def extract_payload(text): + # Try to extract between ===RESULT=== and ===END_RESULT=== + import re + match = re.search(r'===RESULT===(.*?)===END_RESULT===', text, re.DOTALL) + if match: + return match.group(1).strip() + + lines = text.split('\n') + filtered_lines = [] + for line in lines: + # Skip UI elements + if line.strip().startswith('β–Έ'): continue + if line.strip().startswith('●'): continue + if line.strip().startswith('⚠'): continue + if line.strip().startswith('β–€'): continue + if line.strip().startswith('β–ˆ'): continue + if line.strip().startswith('──────────────────────────'): continue + if 'Keyboard: ↑/↓ Navigate' in line: continue + if '? for shortcuts' in line: continue + filtered_lines.append(line) + return '\n'.join(filtered_lines).strip() def process_request(file_path): + try: with open(file_path, 'r') as f: req = json.load(f) + # Delete request file immediately to prevent processing loops + os.remove(file_path) req_id = req.get("request_id") req_type = req.get("type", "prompt") @@ -142,10 +224,14 @@ sender = req.get("sender") resp_file = req.get("response_file") + # Loop Detection + trace = req.get("trace", []) + if target in trace: + raise ValueError(f"Loop detected! Target agent {target} is already in the trace: {trace}") + # Enforce boundary rules if target == "master": - if sender != "orchestrator": - raise ValueError("Master agent can only be triggered by orchestrator agent!") + raise ValueError("Master agent cannot be triggered via file request!") if sender == "master": if target != "orchestrator": @@ -168,7 +254,7 @@ try: agent_num = int(target.split("_")[1]) - target = f"grid.{agent_num - 1}" + target = f"grid.{agent_num}" print(f"Mapped {req.get('target_agent')} to {target}") except ValueError: pass @@ -212,13 +298,36 @@ subprocess.run(cmd, shell=True, check=True) time.sleep(1) # Wait a bit more - # Wait for agent to process further - time.sleep(3) + # Wait for agent to process further or write response file + response_file = req.get("response_file") + output = "" + file_found = False - # Capture pane for response - cap_cmd = f"tmux capture-pane -p -t {SESSION_NAME}:{target}" - result = subprocess.run(cap_cmd, shell=True, capture_output=True, text=True, check=True) - output = result.stdout + if response_file: + # Poll for response file for up to 15 seconds + for i in range(15): + if os.path.exists(response_file): + print(f"Sub-agent response file found: {response_file}") + try: + with open(response_file, 'r') as f: + resp_data = json.load(f) + output = resp_data.get("output", "") + file_found = True + # Delete the file after reading it + os.remove(response_file) + break + except Exception as e: + print(f"Error reading response file: {e}") + time.sleep(1) + + if not file_found: + print(f"Fallback: Capturing pane for {target}") + # Fallback: Capture pane for response + cap_cmd = f"tmux capture-pane -p -t {SESSION_NAME}:{target}" + result = subprocess.run(cap_cmd, shell=True, capture_output=True, text=True, check=True) + output = extract_payload(result.stdout) + + elif req_type == "control": action = req.get("action") @@ -292,17 +401,103 @@ with open(resp_file, 'w') as f: json.dump(resp_data, f, indent=2) - # Delete request - os.remove(file_path) print(f"Completed {req_id}") except Exception as e: print(f"Error processing {file_path}: {e}") -def main(): - print(f"Swarm Orchestrator started polling in {REQUESTS_DIR}...") +def get_agent_dir_name(agent_name): + if agent_name == "grid.0": + return "orchestrator" + elif agent_name.startswith("grid."): + try: + idx = int(agent_name.split(".")[1]) + return f"agent_{idx}" + except ValueError: + pass + return agent_name + +def agent_dir_watcher(agent): + dir_name = get_agent_dir_name(agent) + agent_dir = os.path.join(BASE_DIR, "agents", dir_name) + incoming_dir = os.path.join(agent_dir, "incoming") + output_dir = os.path.join(agent_dir, "output") + archive_dir = os.path.join(agent_dir, "archive") + + print(f"Thread started for agent: {agent} (dir: {dir_name})") + while True: try: + # 1. Watch Output + if os.path.exists(output_dir): + files = os.listdir(output_dir) + if files: + print(f"Debug [{dir_name} output]: {files}", flush=True) + for f in files: + + + if f.endswith(".json"): + match = re.match(r"^to_(agent_\d+|orchestrator|master)_([a-zA-Z0-9_]+)\.json$", f) + + + if match: + target = match.group(1) + msg_id = match.group(2) + target_dir_name = get_agent_dir_name(target) + # Validate target + target_inc_dir = os.path.join(BASE_DIR, "agents", target_dir_name, "incoming") + print(f"Debug [target_inc_dir]: {target_inc_dir}", flush=True) + if os.path.exists(target_inc_dir): + + src_path = os.path.join(output_dir, f) + dst_path = os.path.join(target_inc_dir, f"from_{agent}_{msg_id}.json") + try: + shutil.move(src_path, dst_path) + print(f"Moved {f} from {agent}/output to {target_dir_name}/incoming") + except Exception as e: + print(f"Error moving file: {e}") + else: + print(f"Target dir not found for {target_dir_name}") + else: + print(f"Ignored file not matching pattern: {f}") + + # 2. Watch Incoming + if os.path.exists(incoming_dir): + files = os.listdir(incoming_dir) + for f in files: + if f.endswith(".json"): + src_path = os.path.join(incoming_dir, f) + dst_path = os.path.join(archive_dir, f) + try: + shutil.move(src_path, dst_path) + print(f"Moved {f} to {dir_name}/archive") + # Notify agent pane + cmd = f"tmux send-keys -t {SESSION_NAME}:{agent} \"Read file agents/{dir_name}/archive/{f}\" C-m" + subprocess.run(cmd, shell=True, check=True) + except Exception as e: + print(f"Error processing incoming file: {e}") + + except Exception as e: + print(f"Error in thread for {agent}: {e}") + + time.sleep(1) + +def main(): + print(f"Swarm Orchestrator started polling in {REQUESTS_DIR}...") + + spawned_agents = set() + + while True: + try: + # Dynamic discovery of agents + agents = get_active_agents() + for agent in agents: + if agent not in spawned_agents: + t = threading.Thread(target=agent_dir_watcher, args=(agent,)) + t.daemon = True + t.start() + spawned_agents.add(agent) + # Check hanging agents check_hanging() diff --git a/swarm_framework/orchestrator_SKILL.md b/swarm_framework/orchestrator_SKILL.md new file mode 100644 index 0000000..9bd984b --- /dev/null +++ b/swarm_framework/orchestrator_SKILL.md @@ -0,0 +1,26 @@ +# Orchestrator Communication Skill + +## Overview +This skill allows you to manage the swarm framework and unblock sub-agents that are waiting for approval. + +## Communication Protocol +You communicate by watching the Orchestrator pane (`grid.0`) for notifications and using terminal commands to interact with sub-agents. + +### Handling Sub-Agent Prompts +When a sub-agent hits a prompt (e.g., "Do you want to proceed?"), the bridge code will notify you in your pane (`grid.0`) with a message like: +`[System] Sub-agent grid.N needs approval.` + +### How to Unblock an Agent +To unblock a sub-agent, you can send keys to its `tmux` pane. +**Command:** +`tmux send-keys -t jetski_swarm:grid.N "choice" C-m` + +* `grid.N`: The pane of the sub-agent (e.g., `grid.1`). +* `choice`: The option number or text to answer the prompt (e.g., `"1"` for Yes). +* `C-m`: Sends Enter key. + +**Example:** To select option 1 for Agent 1: +`tmux send-keys -t jetski_swarm:grid.1 "1" C-m` + +## Completion Rule +When you are done or need to notify the Master Agent about results, you MUST write a response file to your `output/` directory (following the Atomicity Rule) or log to `master_notifications.json` if it is a prompt. diff --git a/swarm_framework/sub_agent_SKILL.md b/swarm_framework/sub_agent_SKILL.md new file mode 100644 index 0000000..e512eb2 --- /dev/null +++ b/swarm_framework/sub_agent_SKILL.md @@ -0,0 +1,44 @@ +# Sub-Agent Communication Skill + +## Overview +This skill allows you to communicate with other agents in the swarm using a decentralized, file-based messaging system. + +## Communication Protocol +You communicate by writing JSON files to your `output/` directory and reading files from your `incoming/` directory. + +### 1. Sending a Request +To send a message to another agent, create a JSON file in your `output/` directory: +`output/to_[target]_[unique_id].json` + +**Atomicity Rule:** You MUST write the file with a `.tmp` extension first (e.g., `to_agent_2_123.tmp`) and then rename it to `.json` when the write is complete! + +**JSON Schema:** +```json +{ + "request_id": "req_123", + "type": "prompt", + "sender": "your_agent_name", + "target_agent": "target_agent_name", + "prompt": "Your instructions to the agent here." +} +``` + +* `request_id`: A unique identifier for the request. +* `type`: Must be `"prompt"` for sending instructions. +* `sender`: Your agent name (e.g., `agent_1`). +* `target_agent`: The name of the agent you want to communicate with (e.g., `agent_2`). +* `prompt`: The text message or command you want the agent to execute. + +### 2. Reading a Response +The background Orchestrator will pick up your request, route it to the target, and the response from the target will be placed in your `incoming/` folder as `from_[target]_[original_name].json`. +You should wait for the notification or poll your `incoming/` folder. + +## Communication Boundaries Rules +1. **Do not target the Master Agent directly** via file communication. All notifications for Master must be handled by the Orchestrator. +2. **You can communicate with any other sub-agent or the Orchestrator.** + +## Payload Content Rules +When sending a response or request, ensure the `prompt` or `output` field contains ONLY the relevant information. You MUST wrap your final answer in `===RESULT===` and `===END_RESULT===` markers (e.g., in the `output` field or terminal output). The system will extract content between these markers to remove UI garbage. + +## Completion Rule +When you complete an assigned task or require upper layer attention, you MUST write a response file to your `output/` directory (following the Atomicity Rule) to inform the upper layer. Failure to do so will leave the system waiting indefinitely!