1.4 KiB
1.4 KiB
Implementation Plan: Asynchronous Tool Execution Engine (async_tool_execution_20260303)
Phase 1: Engine Refactoring
- Task: Initialize MMA Environment
activate_skill mma-orchestrator - Task: Refactor
mcp_client.pyfor async execution- WHERE:
mcp_client.py - WHAT: Convert tool execution wrappers to
async defor wrap them in thread executors. - HOW: Use
asyncio.to_threadfor blocking I/O bound tools. - SAFETY: Ensure thread safety for shared resources.
- WHERE:
- Task: Update
ai_client.pydispatcher- WHERE:
ai_client.py(around tool dispatch loop) - WHAT: Use
asyncio.gatherto execute multiple tool calls concurrently. - HOW: Await the gathered results before proceeding with the AI loop.
- SAFETY: Handle tool execution exceptions gracefully without crashing the gather group.
- WHERE:
- Task: Conductor - User Manual Verification 'Phase 1' (Protocol in workflow.md)
Phase 2: Testing & Validation
- Task: Implement async tool execution tests
- WHERE:
tests/test_async_tools.py - WHAT: Write a test verifying that multiple tools run concurrently (e.g., measuring total time vs sum of individual sleep times).
- HOW: Use a mock tool with an explicit sleep delay.
- SAFETY: Standard pytest setup.
- WHERE:
- Task: Full Suite Validation
- Task: Conductor - User Manual Verification 'Phase 2' (Protocol in workflow.md)