DISCOVER THE FUTURE OF AI AGENTS

JoyCode Agent

Added Feb 22, 2026
Agent & Tooling
Open Source
PythonWorkflow AutomationLarge Language ModelsMulti-Agent SystemAI AgentsAgent FrameworkAgent & ToolingModel & Inference FrameworkDeveloper Tools & CodingAutomation, Workflow & RPA

An end-to-end LLM-powered repository-level code repair pipeline open-sourced by JD, featuring intelligent patch generation and collaborative test verification on SWE-bench benchmark, achieving 74.6% resolve rate on SWE-bench Verified with 30-50% lower resource consumption.

JoyCode Agent#

Overview#

JoyCode Agent (JoyCode SWE-bench Agent Pipeline) is an automated code repair system open-sourced by JD OpenSource. It automates the software defect repair workflow—from understanding Issue descriptions, locating code problems, generating repair patches, to creating verification test cases and executing closed-loop verification—forming a complete "Problem → Fix → Verify" automation chain.

Core Capabilities#

High Performance & Cost Efficiency#

  • Achieves 74.6% resolve rate on SWE-bench Verified dataset (373/500)
  • 30-50% lower resource consumption compared to top competitors

Patch-Test Collaborative Generation#

  • Intelligent Test Generation: Automatically creates Fail2Pass and Pass2Pass tests with pre-validation
  • Collaborative Verification: Patch and test co-generation for comprehensive validation
  • Closed-loop Iteration: "Generate → Validate → Refine" cycle replaces single-generation mode

Intelligent Failure Attribution#

  • Root cause analysis: Precisely distinguish Patch issues vs. test issues
  • Targeted retry: Experience-driven retry strategy based on failure analysis
  • CSR-driven learning: Historical success pattern retrieval optimization

Multi-Agent Architecture#

  • Specialized agents: Testing Agent, Patch Agent, CSR Agent, Decision Agent
  • ReAct-based "Observe-Think-Act" cycle
  • LLM-driven Patch voting selection mechanism

Engineering Features#

  • Containerized execution: Isolated environment based on SWE-bench Docker images
  • Repository-level understanding: Multi-file coordination and cross-module reasoning
  • Complete logging: Full trajectory recording with optional compression
  • Multi-LLM support: Flexible model configuration for different pipeline stages

Architecture#

Pipeline Stages#

  1. Container Setup: Pull and start SWE-bench Docker image
  2. Test Generation (optional): Create and validate tests on original code
  3. Agent Execution: Use LLM Agent via cli.py to generate Patch
  4. Verification: Run tests and evaluate Patch quality
  5. Post-processing (optional): Trajectory compression, similarity matching, intelligent retry

Repository Structure#

joycode/
├── run_patch_pipeline.py           # Main entry
├── cli.py                         # Core Agent CLI
├── test_case_generator/           # Test generation logic
├── test/                          # Test execution & verification
├── utils/docker_utils.py          # Container management
├── llm_server/                    # LLM integration layer
└── vote.py                        # Patch voting system

Installation & Quick Start#

Requirements#

  • Python 3.11+
  • Docker (access to docker.1ms.run required)
  • LLM API keys (OpenAI, Anthropic, etc.)

Installation#

git clone https://github.com/jd-opensource/joycode-agent.git
cd joycode
conda create -n joycode python=3.11
conda activate joycode
pip install -r requirements.txt

Quick Start#

# Run with default config
python run_patch_pipeline.py --num-processes 1 --enable-post-processing

# Single instance
python run_patch_pipeline.py --problem-id django__django-11099 --num-processes 1

# Batch processing
python run_patch_pipeline.py --num-examples 10 --num-processes 4

Performance#

Results on SWE-bench Verified dataset:

RepositoryResolve Rate
pytest-dev/pytest17/19 (89.47%)
scikit-learn/scikit-learn28/32 (87.5%)
pydata/xarray19/22 (86.36%)
django/django178/231 (77.06%)
sympy/sympy57/75 (76.0%)
sphinx-doc/sphinx29/44 (65.91%)
matplotlib/matplotlib25/34 (73.53%)
astropy/astropy13/22 (59.09%)
Total373/500 (74.6%)

Use Cases#

  • Automatic open-source project Issue repair
  • Verification test case generation
  • Repository-level code patch generation and verification
  • Automated code repair pipeline construction
  • Enterprise CI/CD integration for bug fixing
  • AI programming research and SWE-bench baseline comparison

Related Projects

View All

STAY UPDATED

Get the latest AI tools and trends delivered straight to your inbox. No spam, just intelligence.