docs: Update workflow rules, create new async tool track, and log journal
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "async_tool_execution_20260303",
|
||||
"title": "Asynchronous Tool Execution Engine",
|
||||
"description": "Refactor the tool execution pipeline to run independent AI tool calls concurrently.",
|
||||
"status": "new",
|
||||
"priority": "medium",
|
||||
"created_at": "2026-03-03T01:48:00Z"
|
||||
}
|
||||
24
conductor/tracks/async_tool_execution_20260303/plan.md
Normal file
24
conductor/tracks/async_tool_execution_20260303/plan.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# 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.py` for async execution
|
||||
- [ ] WHERE: `mcp_client.py`
|
||||
- [ ] WHAT: Convert tool execution wrappers to `async def` or wrap them in thread executors.
|
||||
- [ ] HOW: Use `asyncio.to_thread` for blocking I/O bound tools.
|
||||
- [ ] SAFETY: Ensure thread safety for shared resources.
|
||||
- [ ] Task: Update `ai_client.py` dispatcher
|
||||
- [ ] WHERE: `ai_client.py` (around tool dispatch loop)
|
||||
- [ ] WHAT: Use `asyncio.gather` to 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.
|
||||
- [ ] 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.
|
||||
- [ ] Task: Full Suite Validation
|
||||
- [ ] Task: Conductor - User Manual Verification 'Phase 2' (Protocol in workflow.md)
|
||||
20
conductor/tracks/async_tool_execution_20260303/spec.md
Normal file
20
conductor/tracks/async_tool_execution_20260303/spec.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Track Specification: Asynchronous Tool Execution Engine (async_tool_execution_20260303)
|
||||
|
||||
## Overview
|
||||
Currently, AI tool calls are executed synchronously in the background thread. If an AI requests multiple tool calls (e.g., parallel file reads or parallel grep searches), the execution engine blocks and runs them sequentially. This track will refactor the MCP tool dispatch system to execute independent tool calls concurrently using `asyncio.gather` or `ThreadPoolExecutor`, significantly reducing latency during the research phase.
|
||||
|
||||
## Functional Requirements
|
||||
- **Concurrent Dispatch**: Refactor `ai_client.py` and `mcp_client.py` to support asynchronous execution of multiple parallel tool calls.
|
||||
- **Thread Safety**: Ensure that concurrent access to the file system or UI event queue does not cause race conditions.
|
||||
- **Cancellation**: If an AI request is cancelled (e.g., via user interruption), all running background tools should be safely cancelled.
|
||||
- **UI Progress Updates**: Ensure that the UI stream correctly reflects the progress of concurrent tools (e.g., "Tool 1 finished, Tool 2 still running...").
|
||||
|
||||
## Non-Functional Requirements
|
||||
- Maintain complete parity with existing tool functionality.
|
||||
- Ensure all automated simulation tests continue to pass.
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] Multiple tool calls requested in a single AI turn are executed in parallel.
|
||||
- [ ] End-to-end latency for multi-tool requests is demonstrably reduced.
|
||||
- [ ] No threading deadlocks or race conditions are introduced.
|
||||
- [ ] All integration tests pass.
|
||||
Reference in New Issue
Block a user