Reflection Loop
The reflection loop runs a test command after each write, edit, or multiedit tool call. On non-zero exit the output is re-injected into the agent context so it can iterate until the tests pass or the iteration budget is exhausted.
This feature name is operational: it means test-after-edit feedback. It is not introspective self-evaluation or hidden memory synthesis.
Configuration
Section titled “Configuration”[options.reflection]enabled = truetest_command = "go test ./..."max_iterations = 3Options
Section titled “Options”| Option | Description |
|---|---|
test_command | Shell command to run after each write/edit (e.g. npm test, pytest, cargo test) |
max_iterations | Maximum re-inject cycles before giving up (default: 3) |
How it works
Section titled “How it works”- Agent edits a file
- BMO runs
test_commandin the background - If it exits non-zero, the full output is appended to the context and the agent gets another turn
- Repeat until tests pass or
max_iterationsis exhausted
Relation to Choreography
Section titled “Relation to Choreography”The top-level reflection config is for the global test-after-edit loop described here. Choreography has a separate type: "reflection" hook entry used inside state machine definitions — those are different and coexist without conflict.
Relation to Auto-Debug
Section titled “Relation to Auto-Debug”Auto-Debug triggers on any tool error. Reflection Loop is more targeted — it always runs the same test_command after writes, regardless of whether the write itself succeeded.