Repository navigation
fix: keep rejected actions from leaving an occupied slot - #4063
atul-upadhyay-7 wants to merge 5 commits into
Conversation
Signed-off-by: atul-upadhyay-7 <[email protected]>
Signed-off-by: atul-upadhyay-7 <[email protected]>
|
Performance benchmarks:
|
|
@quaquel, could you review this fix when you have time? the checks passed. the callable-duration limit is explained in the notes. |
|
Thanks. The stuck-busy case is clearly a bug and worth fixing. I'd like to keep this atomic though: the PR now covers both the Could you narrow it to the |
|
@codebreaker32 @EwoutH updated #4063: it's now just the start_action fix (clears the slot if start() raises before activation) with 3 small tests. interrupt_for stays for #4062. happy to adjust whatever you prefer. |
|
Thanks for picking this up! I posted a broader look in #4062 (comment): I think the rollback here treats a symptom, and the root fix is to have the action claim the slot only when it becomes ACTIVE (and run hooks only after the completion event is scheduled). One concrete thing already: the Could you keep this as a draft until the design in #4062 is settled? If you're up for it, this PR could then be reworked into the first step there. |
|
thanks, makes sense. i see it's a draft now, i'll leave it as is until #4062 settles. happy to rework it into the first step if you and codebreaker32 want that. |
|
Thanks for the rejected-start reproducers, @atul-upadhyay-7. Current main now includes #4111: actions claim the slot only when becoming ACTIVE, and both rejected-start regression tests are included. This draft also has merge conflicts. @EwoutH, I recommend treating this draft as superseded by #4111, with interruption validation continuing in #4112. Is there any distinct work here to retain? Automated note by an AI model; it can be wrong, and maintainers make the decisions. About this bot. |
|
agreed, #4111 covers the start_action case and its tests, so there's nothing left here to keep. closing this. thanks for the review on it. |
Pre-PR Checklist
Summary
makes
start_actionclear the agent's slot whenstart()raises before the action becomes active.Bug / Issue
Part of #4062.
an invalid duration (e.g. negative) or restarting a completed action raised inside
start()but leftcurrent_actionset. the agent stayed busy and every laterstart_actionwas rejected.Implementation
start_actionstill assignscurrent_actionbeforestart(), soduration=0works. it now wrapsstart()in try/except and, if the action is not ACTIVE when it raises, resetscurrent_actionto None and re-raises. the duration callable is still called once. an action that already became active is not rolled back.Testing
tests/experimental/test_actions.py: a raising duration callable, restarting a completed action, and on_start raising after activation (slot is kept). the first two fail on main and pass with the fix.tests/experimental: 465 passed. ruff clean on changed files.test_epstein_civil_violence_modelwith thelocator("img") resolved to 2 elementserror described in Flaky Playwright viz tests: initial screenshots hit a strict mode violation #4094. it passes on the latest run.Additional Notes
leaves the
interrupt_forpart of #4062 for a follow-up, as discussed with @EwoutH.