-
Notifications
You must be signed in to change notification settings - Fork 0
fix mypy errors #59
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
fix mypy errors #59
Conversation
| def active(self) -> bool: | ||
| """True if agent loop started, False otherwise.""" | ||
| return self._loop.active | ||
| return cast(bool, self._loop.active) |
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.
There is an issue here. We seem to be using loop.active and loop._active. I think we might have a bug in that logic
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.
Could you point me to an instance of loop._active? I only see _loop.active
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.
nvm, i'm wrong. i was looking into bidi agent loop code, but i missed something.
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.
though this fix still feels a bit unnecessary to me, because _loop.active is a property defined as bool already. anyway, no blockers here
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.
yeah that fix is outdated. There was a discrepancy in errors when I was running mypy directly vs hatch run prepare. Removed the fix above
| class _BidiTextOutput(BidiOutput): | ||
| """Handle text output from bidi agent.""" | ||
|
|
||
| async def start(self) -> None: |
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.
Did mypy complain about this? We use a Protocol for BidiOutput with default implementations of start and stop and so explicitly adding start and stop here should not be necessary.
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.
yeah mypy was complaining about it
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.
We should fix that. It doesn't have to block this PR, but the protocol can be setup not to require these methods.
Description
This PR fixes mypy errors
Related Issues
Documentation PR
Type of Change
Bug fix
New feature
Breaking change
Documentation update
Other (please describe):
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.