Skip to content

feat: LoopAgent exit_condition, ReflectRetry plugin, RunConfig, weather example#3

Merged
zeroasterisk merged 1 commit intomainfrom
feature/batch3-loop-reflect-runconfig-weather
Mar 9, 2026
Merged

feat: LoopAgent exit_condition, ReflectRetry plugin, RunConfig, weather example#3
zeroasterisk merged 1 commit intomainfrom
feature/batch3-loop-reflect-runconfig-weather

Conversation

@zeroasterisk
Copy link
Copy Markdown
Owner

Changes

1. LoopAgent enhancement (#89) — P1

  • Added exit_condition function field that receives context after each iteration
  • Context temp_state merges between iterations for state propagation
  • Graceful stop when no exit_condition and max_iterations reached
  • 15 thorough tests: basic loop, early exit, max iterations, nested loops, escalation interaction

2. ReflectRetry Plugin (#78) — P1

  • New ADK.Plugin.ReflectRetry that intercepts error events in after_run/3
  • Feeds errors back to the agent with reflection context ("try again, here's what went wrong")
  • Configurable max_retries (default: 3)
  • Uses existing Plugin + Callback system
  • 8 tests covering init, error detection, retry success, max retries exhaustion

3. RunConfig (#90) — P2

  • New ADK.RunConfig struct: streaming_mode (:none/:sse/:live), max_llm_calls, output_format, speech_config
  • Validation on construction (invalid streaming modes, non-positive max_llm_calls)
  • Integrated into Runner (accepts run_config: option) and Context
  • 12 tests + 2 doctests

4. Weather Agent Example (#93 partial)

  • Complete runnable Mix project in examples/weather_agent/
  • Demonstrates agent definition, tool creation, runner usage, interactive multi-turn conversation
  • 8 tests, README included

Test Results

  • All new tests pass (37 tests, 4 doctests, 0 failures)
  • Weather agent example: 8 tests, 0 failures
  • Pre-existing failures unchanged (SessionSupervisor/Registry not started in test env)

…er example

- LoopAgent (#89): Added exit_condition function support, context state
  merging between iterations, thorough tests including nested loops
- ReflectRetry plugin (#78): Intercepts error events, feeds errors back
  to agent with reflection context, configurable max retries
- RunConfig (#90): New struct with streaming_mode, max_llm_calls,
  output_format, speech_config; integrated into Runner and Context
- Weather agent example (#93): Complete runnable Mix project with
  agent definition, tool creation, runner usage, README
@zeroasterisk zeroasterisk merged commit 318cf71 into main Mar 9, 2026
0 of 4 checks passed
@zeroasterisk zeroasterisk deleted the feature/batch3-loop-reflect-runconfig-weather branch March 18, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant