How yad4o/local-code-agent works
local-code-agent is a local coding-agent harness: a user supplies a strictly validated plan, and the harness coordinates model-generated tests and implementation, test execution, bounded retries, rollback, and per-step commits. The README documents CLI operations, Ollama and OpenAI backends, resource checks, loop protection, and run transcripts. All runtime components point to agent.py, the sole substantial source file in the tree; its implementation was not excerpted, so relationships below rely on README statements rather than source inspection.
Main entry points: agent.py Step orchestrator
Components 20
User interface
- CLI
agent.py
Plan execution
- Plan validation
agent.py - Step orchestrator
agent.py - Test generation
agent.py - Implementation generation
agent.py - Test runner
agent.py - Retry and repair
agent.py - Step rollback
agent.py - Step commits
agent.py - Workspace
agent.py
Model interaction
- Prompt assembly
agent.py - Model backend
agent.py - Reply parsing
agent.py
Safety and records
- Loop guard
agent.py - Resource checks
agent.py - Run transcript
agent.py - Run log and replies
agent.py
Other components
- Developer
- Ollama
- OpenAI backend
Connections 21
- Developer → CLI: invokes
README.md - CLI → Plan validation: validates
README.md - CLI → Resource checks: checks resources
README.md - CLI → Step orchestrator: starts run
README.md - Step orchestrator → Workspace: works in
README.md - Step orchestrator → Test generation: requests tests
README.md - Step orchestrator → Implementation generation: requests code
README.md - Test generation → Prompt assembly: uses prompts
README.md - Implementation generation → Prompt assembly: uses prompts
README.md - Prompt assembly → Model backend: sends request
README.md - Model backend → Ollama: calls
README.md - Model backend → OpenAI backend: supports
README.md - Model backend → Reply parsing: returns reply
README.md - Model backend → Loop guard: streams through
README.md - Step orchestrator → Test runner: runs tests
README.md - Test runner → Retry and repair: reports failures
README.md - Retry and repair → Step orchestrator: retries step
README.md - Step orchestrator → Step rollback: rolls back failure
README.md - Step orchestrator → Step commits: commits green step
README.md - Step orchestrator → Run transcript: appends exchanges
README.md - Step orchestrator → Run log and replies: records run
README.md