This commit is contained in:
@@ -14,16 +14,19 @@ IO.puts("=" |> String.duplicate(60))
|
||||
try do
|
||||
TaskRegistry.start_link()
|
||||
rescue
|
||||
_ -> :ok # Already started
|
||||
# Already started
|
||||
_ -> :ok
|
||||
end
|
||||
|
||||
try do
|
||||
MCPServer.start_link()
|
||||
rescue
|
||||
_ -> :ok # Already started
|
||||
# Already started
|
||||
_ -> :ok
|
||||
end
|
||||
|
||||
Process.sleep(1000) # Give services time to start
|
||||
# Give services time to start
|
||||
Process.sleep(1000)
|
||||
|
||||
# Test 1: Register two agents
|
||||
IO.puts("\n1️⃣ Registering two test agents...")
|
||||
@@ -58,23 +61,27 @@ resp1 = MCPServer.handle_mcp_request(agent1_req)
|
||||
resp2 = MCPServer.handle_mcp_request(agent2_req)
|
||||
|
||||
# Extract agent IDs
|
||||
agent1_id = case resp1 do
|
||||
%{"result" => %{"content" => [%{"text" => text}]}} ->
|
||||
data = Jason.decode!(text)
|
||||
data["agent_id"]
|
||||
_ ->
|
||||
IO.puts("❌ Failed to register agent 1: #{inspect(resp1)}")
|
||||
System.halt(1)
|
||||
end
|
||||
agent1_id =
|
||||
case resp1 do
|
||||
%{"result" => %{"content" => [%{"text" => text}]}} ->
|
||||
data = Jason.decode!(text)
|
||||
data["agent_id"]
|
||||
|
||||
agent2_id = case resp2 do
|
||||
%{"result" => %{"content" => [%{"text" => text}]}} ->
|
||||
data = Jason.decode!(text)
|
||||
data["agent_id"]
|
||||
_ ->
|
||||
IO.puts("❌ Failed to register agent 2: #{inspect(resp2)}")
|
||||
System.halt(1)
|
||||
end
|
||||
_ ->
|
||||
IO.puts("❌ Failed to register agent 1: #{inspect(resp1)}")
|
||||
System.halt(1)
|
||||
end
|
||||
|
||||
agent2_id =
|
||||
case resp2 do
|
||||
%{"result" => %{"content" => [%{"text" => text}]}} ->
|
||||
data = Jason.decode!(text)
|
||||
data["agent_id"]
|
||||
|
||||
_ ->
|
||||
IO.puts("❌ Failed to register agent 2: #{inspect(resp2)}")
|
||||
System.halt(1)
|
||||
end
|
||||
|
||||
IO.puts("✅ Agent 1 (Alpha Wolf): #{agent1_id}")
|
||||
IO.puts("✅ Agent 2 (Beta Tiger): #{agent2_id}")
|
||||
@@ -219,7 +226,7 @@ history_req1 = %{
|
||||
history_resp1 = MCPServer.handle_mcp_request(history_req1)
|
||||
IO.puts("Agent 1 history: #{inspect(history_resp1)}")
|
||||
|
||||
IO.puts("\n" <> "=" |> String.duplicate(60))
|
||||
IO.puts(("\n" <> "=") |> String.duplicate(60))
|
||||
IO.puts("🎉 AGENT-SPECIFIC TASK POOLS TEST COMPLETE!")
|
||||
IO.puts("✅ Each agent now has their own task pool")
|
||||
IO.puts("✅ No more task chaos or cross-contamination")
|
||||
|
||||
Reference in New Issue
Block a user