Skip to content

refactor: unify agent runner lifecycle hooks - #2541

Merged
Re-bin merged 1 commit into
mainfrom
refactor/agent-runner-hooks
Mar 27, 2026
Merged

Re-bin merged 1 commit into
mainfrom
refactor/agent-runner-hooks

Conversation

@Re-bin

@Re-bin Re-bin commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • introduce a small shared hook interface for AgentRunner
  • replace scattered runner callbacks with a single lifecycle hook contract
  • migrate loop and subagent onto the new interface while preserving existing behavior

Why

AgentRunner had started to accumulate several ad-hoc callback entry points,
which made the execution surface harder to extend and harder to read.

This change keeps the runner focused on the core execution loop and moves
lifecycle customization behind one small shared abstraction.

It also lays the groundwork for team mode, where team workers will need a
cleaner way to plug per-iteration behavior into the shared runner without
pushing team-specific logic down into the runner itself.

Test plan

  • pytest tests/agent/test_runner.py tests/agent/test_task_cancel.py
  • pytest tests/cli/test_cli_input.py

@Re-bin
Re-bin merged commit 5bf0f6f into main Mar 27, 2026
3 checks passed
@Re-bin
Re-bin deleted the refactor/agent-runner-hooks branch March 29, 2026 14:57
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