feat(F-LOOP): true ReAct loop with structured Thought/Action/Observation step tracking
Check Cross-Plugin Imports / check (push) Has been cancelled

- app/ai/agent_loop.py: ReActStep + ReActResult dataclasses, run_react_loop()
  with LLM→Tool→Observe loop, max_steps/timeout graceful stop, ErrorCategory
  retry (TRANSIENT→retry, PERMANENT→stop, PARTIAL→continue), cost accumulation,
  agent.step hook, on_step callback
- app/plugins/builtins/automation/models.py: AgentRunStep model
- alembic/versions/0121_agent_run_steps.py: migration for agent run steps table
- app/plugins/builtins/automation/agent_runner.py: refactored to use run_react_loop(),
  saves steps to DB, updates AgentRun with cost/status/duration
- tests/test_agent_loop.py: 11 tests (all passing, mocked, no DB/LLM needed)
- PROGRESS.md: Phase F started, F-LOOP marked done
This commit is contained in:
Agent Zero
2026-08-17 16:11:26 +02:00
parent da9be1e2f2
commit c760b5961c
6 changed files with 1100 additions and 133 deletions
+11 -1
View File
@@ -15,7 +15,7 @@
| C.5 — Import/Export | `done` | 2026-08-13 | 2026-08-13 | 8 | 8 |
| D — Undo/Restore | `done` | 2026-08-13 | 2026-08-13 | 13 | 13 |
| E — Search | `done` | 2026-08-14 | 2026-08-14 | 24 | 24 |
| F — Agents | `not_started` | — | — | 0 | ~28 |
| F — Agents | `in_progress` | 2026-08-17 | — | 1 | ~28 |
| G — Workflows | `not_started` | — | — | 0 | ~24 |
| H — Knowledge | `not_started` | — | — | 0 | ~18 |
| I — Integration & Workstream | `not_started` | — | — | 0 | ~25 |
@@ -237,6 +237,16 @@ Detaillierte Task-Listen werden beim Start der jeweiligen Phase eingetragen. Sie
---
## Phase F — Agents
### F.1 ReAct Loop
| Task | Status | Forgejo Issue | Verifiziert |
|------|-------|---------------|------------|
| F-LOOP | `done` | — | ✅ `app/ai/agent_loop.py` — ReActStep/ReActResult dataclasses + `run_react_loop()` mit LLM→Tool→Observe Loop, max_steps/timeout Graceful-Stop, ErrorCategory-basiertes Retry (TRANSIENT→retry, PERMANENT→stop, PARTIAL→continue), Cost-Accumulation, `agent.step` Hook. `AgentRunStep` Model + Migration 0121. `agent_runner.py` auf ReAct-Loop umgestellt. 11/11 Tests grün (mocked, kein DB/LLM benötigt) |
---
## Blockierte Tasks
| Task | Grund | Blockiert seit | Lösung |