AI Coding Agent with Parallel Tool Execution
Note
This is an enhanced fork of OpenCode with significant performance improvements and architectural enhancements.
- Resource Lock Manager: Sophisticated shared/exclusive lock system for safe concurrent operations
- Dependency-Aware Scheduling: Intelligent analysis of tool dependencies to maximize parallelism while ensuring data consistency
- Adaptive Concurrency: Dynamic adjustment of parallel tool limits based on execution duration and error rates
- Read Operations Parallelization: Multiple read-only tools (
read,grep,list,glob) execute simultaneously, drastically reducing wait times
- Precise Code Navigation: Jump directly to symbols, functions, classes, or line numbers with 1-based indexing
- Smart Code Editing: Multiple matching strategies (
exact,fuzzy,block,regex) withanchorLinesconstraints - Safe Edit Modes:
dryRunandvalidateOnlyoptions for risk-free code modifications - Intelligent Error Recovery: Context-aware suggestions when edits fail (e.g., "Did you mean line X?")
- Tool Result Caching: Automatic caching of read operations to avoid redundant executions
- Async Lazy Loading: Heavy components (Tree-Sitter parsers) load on-demand for faster startup
- Storage Write Batching: Aggregated state updates reduce I/O overhead
- Optimized Processing Loops: Refactored core engine for smoother execution flow
- Work Queue Integration: Robust background task management with priority scheduling
- Streamlined terminal interface with better responsiveness
- Enhanced progress indicators for parallel operations
- Improved error visualization and debugging output
# Clone and install
git clone <your-repo-url>
cd opencode
bun install
# Build
bun run build
# Run
cd packages/opencode
bun run startAdd to your ~/.opencode/config.json:
{
"experimental": {
"parallel_execution": true,
"max_parallel_tools": 16
}
}┌─────────────────────────────────────────────────────────────┐
│ Tool Orchestrator │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Dependency │ │ Resource │ │ Adaptive Limiter │ │
│ │ Graph │ │ Locks │ │ (Dynamic Concurrency)│ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ read │ │ grep │ │ bash │
│ (parallel)│ │(parallel)│ │(serial) │
└─────────┘ └─────────┘ └─────────┘
This fork focuses on performance and tool enhancements. Contributions welcome!
Original Project: OpenCode | License: MIT