-
Notifications
You must be signed in to change notification settings - Fork 8.2k
fix/issue-1716-event-driven-pause-resume #2977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
…thub.com/MagellaX/browser-use into fix/issue-1716-event-driven-pause-resume
Co-authored-by: alphacr792 <[email protected]>
- Add fallback return statement to satisfy type checker (fixes 'must return value on all code paths' error) - Use setattr() for model_kwargs assignment (fixes 'Cannot assign to attribute' error) These fixes resolve the failing CI jobs in PR #2583.
Remove trailing whitespace on line 242 that was causing ruff-format to fail in CI.
…driven-pause-resume
- Renamed the internal pause event from `_pause_event` to `_external_pause_event` for clarity and to better reflect its purpose in managing external pause control. - Updated all references to the renamed event to ensure consistent functionality. This change enhances the readability and maintainability of the code related to agent pause/resume operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 3 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
Agent Task Evaluation Results: 2/4 (50%)View detailed results
Check the evaluate-tasks job for detailed task execution logs. |
- Added a signal to the external pause event when the agent is stopped, allowing any waiting code to check the stopped state. This improves the responsiveness of the agent's pause functionality.
- Removed unnecessary blank line in the `stop` method of the Agent class to improve code cleanliness and maintainability.
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.
Auto-generated PR for branch: fix/issue-1716-event-driven-pause-resume
Summary by cubic
Switches agent pause/resume to an event-driven model using asyncio.Event and consolidates pause state in AgentState. Removes polling, reduces CPU use while paused, and treats stop as an immediate interrupt (addresses #1716).