Fix inbox creation issues in agent coordinator

- Fixed Task.new/3 to handle both maps and keyword lists
- Added robust inbox existence checking in find_available_agent
- Ensure inbox creation during agent registration and task assignment
- Add helper function ensure_inbox_exists to avoid crashes
This commit is contained in:
Ra
2025-08-23 14:46:28 -07:00
parent 5048db99c7
commit 943d8ad4d7
40 changed files with 7798 additions and 404 deletions

46
scripts/test_mcp_stdio.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
# Test script for MCP server stdio interface
echo "🧪 Testing AgentCoordinator MCP Server via stdio"
echo "================================================"
# Start the MCP server in background
./mcp_launcher.sh &
MCP_PID=$!
# Give it time to start
sleep 3
# Function to send MCP request and get response
send_mcp_request() {
local request="$1"
echo "📤 Sending: $request"
echo "$request" | nc localhost 12345 2>/dev/null || echo "$request" >&${MCP_PID}
sleep 1
}
# Test 1: Get tools list
echo -e "\n1⃣ Testing tools/list..."
TOOLS_REQUEST='{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
send_mcp_request "$TOOLS_REQUEST"
# Test 2: Register agent
echo -e "\n2⃣ Testing register_agent..."
REGISTER_REQUEST='{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"register_agent","arguments":{"name":"TestAgent","capabilities":["coding","testing"]}}}'
send_mcp_request "$REGISTER_REQUEST"
# Test 3: Create task
echo -e "\n3⃣ Testing create_task..."
TASK_REQUEST='{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"create_task","arguments":{"title":"Test Task","description":"A test task","priority":"medium","required_capabilities":["coding"]}}}'
send_mcp_request "$TASK_REQUEST"
# Test 4: Get task board
echo -e "\n4⃣ Testing get_task_board..."
BOARD_REQUEST='{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"get_task_board","arguments":{}}}'
send_mcp_request "$BOARD_REQUEST"
# Clean up
sleep 2
kill $MCP_PID 2>/dev/null
echo -e "\n✅ MCP server test completed"