Conversation
…d, observability.events - Add EXECUTION_START and EXECUTION_END imports from amplifier_core.events - Move asyncio to top-level import (was inline inside execute method) - Emit execution:start after prompt:submit processing (skipped on deny) - Wrap main loop body in try/except/finally to emit execution:end on ALL exit paths - status='completed' on normal completion - status='cancelled' on cancellation paths (loop-start, post-provider, post-tools) - status='cancelled' for asyncio.CancelledError exceptions - status='error' for all other exceptions - Add tool_call_id to TOOL_PRE event payload - Add tool_call_id to TOOL_POST event payload - Add tool_call_id to both TOOL_ERROR event payloads (not-found and exception paths) - Register observability.events in mount() with execution:start and execution:end Tests added in tests/test_lifecycle_events.py: - test_execution_start_fires_with_prompt - test_execution_end_fires_on_normal_completion - test_execution_end_response_matches_return_value - test_execution_start_not_fired_when_prompt_submit_denied - test_execution_end_fires_cancelled_at_loop_start - test_execution_end_fires_cancelled_after_provider - test_execution_end_fires_on_provider_exception - test_execution_end_fires_exactly_once - test_tool_pre_includes_tool_call_id - test_tool_post_includes_tool_call_id - test_tool_error_not_found_includes_tool_call_id - test_tool_error_exception_includes_tool_call_id - test_mount_registers_observability_events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Normalize amplifier-module-loop-basic with execution lifecycle events and tool_call_id support:
Context
Part of the Event System Improvements for Navigation Graph Support initiative.
Design doc: https://github.com/colombod/amplifier-event-and-data-model-for-context-intelligence