11# codex-self-iter
22
3- ` codex-self-iter ` is a plugin-style repository that runs a continuous autonomous loop for coding tasks :
3+ ` codex-self-iter ` is a plugin-style repository that runs a continuous autonomous goal loop :
44
551 . Read ` TASK.md ` + ` plan.md `
6- 2 . Generate one small next step
7- 3 . Execute the step via agent command
8- 4 . Review result and decide whether to continue
9- 5 . Repeat until no meaningful next action exists or user stops it
6+ 2 . Execute one autonomous iteration in the repository
7+ 3 . Require the agent to emit a concrete ` next_goal `
8+ 4 . Persist that goal and continue from it
9+ 5 . Repeat until completion/stop condition
1010
1111## Repository Layout
1212
@@ -62,6 +62,8 @@ Or use:
6262- ` .codex-self-iter/prompts/ ` : planner/executor/reviewer prompts
6363- ` .codex-self-iter/logs/iterations.jsonl ` : loop records
6464- ` .codex-self-iter/status.json ` : last iteration state
65+ - ` .codex-self-iter/runtime.json ` : persisted backoff counters and window
66+ - ` .codex-self-iter/loop.lock ` : single-instance guard file
6567
6668## Configuration
6769
@@ -72,6 +74,10 @@ Important fields:
7274- ` agent_command_template ` must include ` {prompt_file} `
7375- ` max_iterations = 0 ` means unbounded loop
7476- ` max_stagnation ` prevents infinite cycling on identical ` next_focus `
77+ - ` no_change_gate ` throttles no-op loops when no new git changes appear
78+ - ` backoff_* ` fields control exponential cooldown behavior
79+ - ` lock_file_name ` controls the single-instance lock path under state-dir
80+ - ` completion_promise ` marks completion when included in output
7581
7682## Approval and Privilege Mode
7783
@@ -91,6 +97,20 @@ In bypass mode, wrapper uses:
9197- ` codex --dangerously-bypass-approvals-and-sandbox exec ... `
9298 This disables approvals and sandboxing entirely. Use only in externally sandboxed environments.
9399
100+ ## Binary Resolution (macOS launchd/system services)
101+
102+ When running under ` launchd ` (or other service managers), interactive shell ` PATH ` is often not inherited.
103+ If ` codex ` is not found, set an explicit binary path:
104+
105+ ``` bash
106+ export CODEX_BIN=/absolute/path/to/codex
107+ ```
108+
109+ The default wrapper checks in this order:
110+ 1 . ` CODEX_BIN ` (if executable)
111+ 2 . ` PATH ` via ` command -v codex `
112+ 3 . common fallback paths (nvm/Homebrew/local bin)
113+
94114## Development
95115
96116Run tests:
0 commit comments