Skip to content

feat(events): emit GOAL_ACHIEVED on terminal-node success#6499

Open
gavksingh wants to merge 1 commit intoaden-hive:mainfrom
gavksingh:feat/emit-goal-achieved-event
Open

feat(events): emit GOAL_ACHIEVED on terminal-node success#6499
gavksingh wants to merge 1 commit intoaden-hive:mainfrom
gavksingh:feat/emit-goal-achieved-event

Conversation

@gavksingh
Copy link
Copy Markdown
Contributor

Summary

  • Add emit_goal_achieved() convenience method to EventBus, mirroring the pattern of existing emitters like emit_constraint_violation()
  • Emit GOAL_ACHIEVED from GraphExecutor when execution completes at a terminal node successfully
  • Update EVENT_TYPES.md to document the payload shape and emission point
  • Add unit + integration tests for the new emission

The GOAL_ACHIEVED EventType was already defined in the enum and fully handled by the TUI (subscription, chat_repl handler, log_pane formatting), but no backend code ever emitted it. This completes the agent lifecycle observability story.

Fixes #5736

Test plan

  • emit_goal_achieved() publishes an AgentEvent with correct type, stream_id, execution_id, and data
  • Default output is {} when None is passed
  • GraphExecutor calls emit_goal_achieved on successful terminal-node completion
  • GraphExecutor works without crash when event_bus is None
  • Existing test_executor_skips_events_for_event_loop_nodes updated to distinguish node-level vs graph-level events
  • All 774 existing tests pass (no regressions)
  • ruff check passes on all modified files

Copy link
Copy Markdown
Collaborator

@bryanadenhq bryanadenhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for wiring up the GOAL_ACHIEVED event, that part looks clean and straightforward. However, this PR bundles in significant fan-out executor changes (memory conflict detection, per-branch timeouts, refactored result processing) that aren't related to the goal achieved event or #5736. Could you split those into a separate PR? It'll make both easier to review and safer to merge/revert independently.

The GOAL_ACHIEVED EventType was defined in the enum and fully handled
by the TUI (subscription, chat_repl handler, log_pane formatting),
but no backend code ever emitted it. This wires up the missing emission:

- Add emit_goal_achieved() convenience method to EventBus
- Emit GOAL_ACHIEVED from GraphExecutor when execution reaches a
  terminal node successfully
- Update EVENT_TYPES.md to document the payload and emission point
- Add tests for both the EventBus method and executor integration

Fixes aden-hive#5736
@gavksingh gavksingh force-pushed the feat/emit-goal-achieved-event branch from 0aab93e to 8c0270a Compare March 16, 2026 13:53
@gavksingh
Copy link
Copy Markdown
Contributor Author

gavksingh commented Mar 16, 2026

@bryanadenhq thanks for pointing that out! The executor changes (branch timeout + memory conflict) were from #5706 which I also worked on and got merged separately via PR #6504. Forgot to rebase this branch after that. Rebased and force pushed now so this PR only has the GOAL_ACHIEVED event emission.

@gavksingh gavksingh requested a review from bryanadenhq March 17, 2026 14:53
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.

[Feature]: emit GOAL_ACHIEVED event on terminal-node success

2 participants