Whxuan0701 opened a new pull request, #892: URL: https://github.com/apache/burr/pull/892
Add an explicit per-call execution budget so applications with intentional agent loops can fail safely instead of running without a bound. ## Changes - add `max_steps` to `run`, `arun`, `iterate`, and `aiterate` - raise a public `ApplicationExecutionLimitError` only when another action remains after the allowed steps - expose the limit, last action, and current state on the exception for persistence or escalation - keep natural graph completion and halt conditions higher priority than the budget error - validate positive integer budgets and document inspection and resume behavior ## How I tested this - `pre-commit run --all-files` - `python -m pytest tests --ignore=tests/integrations/persisters --ignore=tests/integrations/test_bip0042_bedrock.py -q` (`655 passed, 1 skipped`) - `python -m sphinx -T -W --keep-going -b dirhtml -d <doctrees> -D language=en . <html>` from `docs/` ## Notes The budget is local to one execution call and does not depend on the application's global sequence ID. A caller can inspect the exception state and resume with a later call. ## Checklist - [x] PR has an informative and human-readable title (this will be pulled into the release notes) - [x] Changes are limited to a single goal (no scope creep) - [x] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered. - [x] Any _change_ in functionality is tested - [x] New functions are documented (with a description, list of inputs, and expected output) - [x] Placeholder code is flagged / future TODOs are captured in comments - [x] Project documentation has been updated if adding/changing functionality. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
