Skip to content

YunlongJ/fast-opencode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8,720 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Enhanced

AI Coding Agent with Parallel Tool Execution

English | 简体中文


Note

This is an enhanced fork of OpenCode with significant performance improvements and architectural enhancements.

✨ Key Enhancements

🚀 Parallel Tool Execution Engine

  • 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

🔧 Enhanced Tools

  • 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) with anchorLines constraints
  • Safe Edit Modes: dryRun and validateOnly options 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

⚡ Performance Optimizations

  • 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

🎨 UI Improvements

  • Streamlined terminal interface with better responsiveness
  • Enhanced progress indicators for parallel operations
  • Improved error visualization and debugging output

📦 Installation

# Clone and install
git clone <your-repo-url>
cd opencode
bun install

# Build
bun run build

# Run
cd packages/opencode
bun run start

⚙️ Configuration

Add to your ~/.opencode/config.json:

{
  "experimental": {
    "parallel_execution": true,
    "max_parallel_tools": 16
  }
}

🏗️ Architecture Highlights

┌─────────────────────────────────────────────────────────────┐
│                    Tool Orchestrator                        │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐ │
│  │ Dependency  │  │   Resource  │  │  Adaptive Limiter   │ │
│  │   Graph     │  │    Locks    │  │  (Dynamic Concurrency)│ │
│  └─────────────┘  └─────────────┘  └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        ▼                     ▼                     ▼
   ┌─────────┐          ┌─────────┐          ┌─────────┐
   │  read   │          │  grep   │          │  bash   │
   │ (parallel)│        │(parallel)│         │(serial) │
   └─────────┘          └─────────┘          └─────────┘

🤝 Contributing

This fork focuses on performance and tool enhancements. Contributions welcome!


Original Project: OpenCode | License: MIT

About

The open source coding agent.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors