Add Execution Limits and Statistics Tracking to AgentForge#7
Merged
madawei2699 merged 7 commits intomainfrom Mar 25, 2025
Merged
Add Execution Limits and Statistics Tracking to AgentForge#7madawei2699 merged 7 commits intomainfrom
madawei2699 merged 7 commits intomainfrom
Conversation
…runtime limits tests
feat: implement execution limits in process_with_limits and runtime execution test: add integration tests for execution limits and state persistence
…ts and runtime limits tests
Pull Request Test Coverage Report for Build eb397242e248ed91e65d1cdecfc1b2c7a60a6042-PR-7Details
💛 - Coveralls |
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.
Overview
This PR introduces execution limits and statistics tracking to the AgentForge framework, allowing users to set timeouts for flow processing and collect performance metrics. These features enhance the framework's reliability and observability by preventing long-running processes and providing insights into execution performance.
Key Changes
1. Timeout Support
process_with_limitsfunctionality toFlowand exposed it through the top-level APITaskmodule with configurable duration2. Execution Statistics
ExecutionStatsmodule for collecting and analyzing flow execution metricsget_last_execution_stats3. Helper Functions
always_emit/2: Creates a handler that always emits a specified signal type and datafilter_type/2: Creates a handler that processes only signals of a specific typestore_in_state/1: Creates a handler that stores signal data in state under a given key4. Documentation and Examples
5. Backward Compatibility
Testing
Usage Example
This feature helps users prevent runaway executions and gain visibility into their workflows' performance characteristics, making AgentForge more robust for production environments.