Plans & Execution
How Codeteel plans changes and executes them after your approval.
Plan format
When you request a code change, Codeteel creates a text-only plan. No code is shown at this stage — code is generated per step during execution.
📋 Add health endpoint
1. MODIFY src/webhook.py
Add /health route that returns {status: ok}
2. MODIFY src/webhook.py
Add import for json module
[Approve] [Reject]Approval methods
Three layers, from most reliable to least:
- UI buttons — Click [Approve] or [Reject]. 100% reliable.
- Text detection — Type "yes", "go ahead", "proceed", "lgtm", "ship it". Detected before the LLM sees it.
- LLM fallback — Any other message while a plan is pending is interpreted by the LLM.
Execution flow
After approval, each step executes in order:
- Read the current file from GitHub (always fresh, includes prior step changes)
- LLM generates the exact code change for this step
- Change applied deterministically (exact string match + replace)
- Committed to the working branch
- Diff shown in the chat
Error handling
If a step fails (e.g., the target string is not found in the file), the agent retries up to 3 times with corrected context. Common scenarios:
- String not found — agent re-reads the file and adjusts the match
- Multiple matches — agent includes more surrounding context to make the match unique
- 3 failures — step is marked as failed, error shown, execution continues to next step
✓
Plans can involve create, modify, and delete operations in a single plan. Files are read fresh before each step, so multi-step edits to the same file work correctly.