How fendouai/codexsaver works
CodexSaver is an MCP tool, also exposed through a CLI, that routes Codex work to lower-cost workers when the task is safe and bounded. Its main workflow is risk-based routing, then either specialist orchestration or a bounded work packet whose changes are sandboxed and verified before Codex reviews them. The README also documents worker discovery, provider configuration, and output compression. Some internal connections are supported only by the README or source index; unsampled implementation details are not inferred.
Main entry points: orchestrator.py Specialist orchestration · engine.py Delegation engine · work_packet.py Work packet runtime · work_graph.py Work graph
Components 22
Product entry
- MCP tools
codexsaver_mcp.py - CLI
cli.py - Delegation engine
codexsaver/engine.py
Routing and policy
- Risk router
codexsaver/router.py - Action policy
codexsaver/policy.py - Work graph
codexsaver/work_graph.py
Worker execution
- Specialist orchestration
codexsaver/orchestrator.py - Specialist profiles
codexsaver/specialists.py - Patch aggregation
codexsaver/aggregator.py - Work packet runtime
codexsaver/work_packet.py - Context packing
codexsaver/context.py
Verification and handoff
- Patch verifier
codexsaver/verifier.py - Task ledger
codexsaver/ledger.py
Configuration and workers
- Agent discovery
codexsaver/agent_registry.py - Worker selection
codexsaver/agent_router.py - Pi Agent client
codexsaver/pi_agent.py - LLM provider client
codexsaver/provider.py - Provider config
codexsaver/config.py - Runtime schemas
codexsaver/schema.py
Other components
- Codex
- Worker agents
- LLM provider service
Connections 29
- Codex → MCP tools: invokes tools
README.md - Codex → CLI: runs commands
README.md - MCP tools → Delegation engine: dispatches requests
codexsaver_mcp.py - CLI → Delegation engine: dispatches requests
cli.py - Delegation engine → Risk router: checks risk
README.md - Delegation engine → Work packet runtime: runs bounded work
README.md - Delegation engine → Specialist orchestration: starts orchestration
README.md - Specialist orchestration → Work graph: plans work graph
README.md - Work graph → Action policy: applies risk policy
codexsaver/work_graph.py - Specialist orchestration → Specialist profiles: uses profiles
codexsaver/orchestrator.py - Specialist orchestration → Patch aggregation: aggregates patches
README.md - Specialist orchestration → Work packet runtime: runs patch nodes
README.md - Work packet runtime → Context packing: loads file context
codexsaver/work_packet.py - Work packet runtime → LLM provider client: requests worker output
codexsaver/work_packet.py - Work packet runtime → Patch verifier: verifies changes
README.md - Specialist orchestration → Patch verifier: checks patch results
README.md - Patch verifier → Codex: hands off for review
README.md - Specialist orchestration → Agent discovery: discovers workers
README.md - Specialist orchestration → Worker selection: selects workers
README.md - Specialist orchestration → Pi Agent client: dispatches to Pi
README.md - Pi Agent client → Worker agents: runs agent command
codexsaver/pi_agent.py - LLM provider client → LLM provider service: sends completions
codexsaver/provider.py - LLM provider client → Provider config: resolves settings
codexsaver/provider.py - Delegation engine → Provider config: loads provider settings
codexsaver/engine.py - Delegation engine → Context packing: packs task context
codexsaver/engine.py - Delegation engine → Runtime schemas: uses request models
codexsaver/engine.py - Specialist orchestration → Runtime schemas: uses work models
codexsaver/orchestrator.py - Work graph → Runtime schemas: uses graph models
codexsaver/work_graph.py - Delegation engine → Task ledger