feat: step isolation — each step runs in independent sub-loop

Main loop becomes a coordinator that reviews step summaries and may
revise the plan. Each step gets its own chat history and scratchpad,
preventing context pollution across steps.

- Add run_step_loop with 50-iteration limit and isolated context
- Replace advance_step with step_done (sub-loop only)
- Add coordinator review after each step completion
- Add scratchpad 8K capacity check
- Add 33 unit tests for state, tools, and message building
This commit is contained in:
Fam Zheng
2026-03-08 08:35:41 +00:00
parent 47546a9d15
commit feb2a08d97
4 changed files with 1159 additions and 225 deletions

File diff suppressed because it is too large Load Diff