Skip to content

feat(control): add agent_end event subscription and wait support#44

Open
kylerky wants to merge 1 commit into
mitsuhiko:mainfrom
kylerky:agent_end
Open

feat(control): add agent_end event subscription and wait support#44
kylerky wants to merge 1 commit into
mitsuhiko:mainfrom
kylerky:agent_end

Conversation

@kylerky
Copy link
Copy Markdown

@kylerky kylerky commented May 20, 2026

Summary

Adds agent_end event support to the control extension, alongside the existing turn_end event.

Changes

  • Subscribe command now accepts "agent_end" as an event type (alongside "turn_end")
  • agent_end event handler fires to all subscribers when the agent loop completes — this spans multiple turns,
    unlike turn_end which fires after each individual turn
  • wait_until parameter for send actions now accepts "agent_end" (in addition to "turn_end" and
    "message_processed")
  • CLI bridge (--send-session-wait) supports agent_end as a wait mode
  • Subscribe-before-send ordering fix: the subscription is now registered before the command is sent, ensuring the
    event is always caught regardless of timing

Why

turn_end fires after each AI turn, but sometimes callers want to wait for the entire agent loop to finish (which may
involve multiple turns with tool calls). agent_end signals true completion of the agent processing cycle.

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